Jump to content

Colour keying and creating sprite from bitmap data


Recommended Posts

Hi all,


The game I'm working on divides players into teams; each with its own colour.  I've created the unit assets such that there are regions of each sprite with a placeholder colour that is to be replaced by its team colour.


So here's my 2 part question.


1) Is it possible to edit the bitmap data of a sprite one it has been created? (some kind of lock/unlock equivalent?)


2) I've tried creating a sprite from bitmap data, and it doesn't seem to work.

sprite = new Phaser.Sprite(game, 0, 0, "archer"); //Worksbmd = new Phaser.BitmapData(game, "archer");sprite = new Phaser.Sprite(game, 0, 0, bmd);      //Does not work - 

The asset is loaded as a SpriteSheet, if that makes any difference.


Appreciate any advice.


Thank you!


Link to comment
Share on other sites


  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...