arcbox 1 Posted February 27, 2014 Report 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! Quote Link to post Share on other sites
Solution rich 2610 Posted February 27, 2014 Solution Report 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. Quote Link to post Share on other sites
arcbox 1 Posted February 27, 2014 Author Report 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! Quote Link to post Share on other sites
rich 2610 Posted February 28, 2014 Report Share Posted February 28, 2014 You just do Sprite.tint and give it a colour value (try Math.random() * 0xFFFFFF for a random colour). Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.