arcbox Posted February 27, 2014 Share Posted February 27, 2014 Hello, I am new to Phaser and I'm currently investigating whether the framework suits my projects needs. One of the requirements is that we can loop through an images pixel array (in this case, a players hair), and change the color of the pixels. Is this kind of image control available? Thanks! Link to comment Share on other sites More sharing options...
rich Posted February 27, 2014 Share Posted February 27, 2014 You'd be better off waiting for 1.2 which allows you to tint Sprites to any colour. That would be significantly more efficient imho. You'd need to split your hair layer away from the rest of the player, but otherwise it'd work fine. Link to comment Share on other sites More sharing options...
arcbox Posted February 27, 2014 Author Share Posted February 27, 2014 That seems reasonable, we already split out the entire head from the rest of the player, so splitting out just the hair would work. I'm using the 1.2 beta right now, is there anywhere to look for documentation on how to tint the Sprites? Thanks for the response! Link to comment Share on other sites More sharing options...
rich Posted February 28, 2014 Share Posted February 28, 2014 You just do Sprite.tint and give it a colour value (try Math.random() * 0xFFFFFF for a random colour). Link to comment Share on other sites More sharing options...
Recommended Posts