Is it possible to replace a threshold of colors in a source image?


(Teonnyn) #1

I’ve created a white character that I designed to be recolored, along with it’s corrisponding sprite sheet. I would like to be able to replace the color within a threshold - without having to separate the whole thing into different maps and increasing the size of the storage space used. I know this is roughly possible but I’m not sure how to do it within FlashPunk, although I have a feeling a source class could be used to create a BitmapData that could then be altered before it’s made into a new Image/Spritemap.


(Bora Kasap) #2

I think you should make what you said you don’t wanna make because file size. Because, if you give threshold with pixel draw, you’ll get more performance loss.

But if you want to make it with an ingame pixelmask, i think you should create a bitmap data and you should target your draw function to this bitmap data. Then you should use point collision check to do this with pixelmask because of you want to colorize things not square or rectangle… And processor works so much with this way… I think you should use different sprites or you should use addGraphic to colorize specific parts of graphic…