threedollarbill Posted May 25, 2017 Share Posted May 25, 2017 The client I am working for wants to be able to change how elements inside the game are colored just by just changing a variable in the code (for example "#FF0000" for red, or "#00FF00" green). So basically, what I plan to do is to just tint the sprites to whatever color on runtime, and then draw them to a BitmapData then save it in the cache so I can reuse them over and over without making it too expensive for the CPU (I've read that tinted sprites are heavy when on Phaser.CANVAS). My question is, is creating a lot of BitmapData bad? Apart from the memory that they will take up, is there anything I should be concerned about? I've read that each BitmapData is actually a new canvas. If so, does that mean a lot of BMD = a lot of new canvases = slower performance? Haha I hope I'm making sense. snowbillr 1 Link to comment Share on other sites More sharing options...
Skeptron Posted May 29, 2017 Share Posted May 29, 2017 To me the only criteria you should be worried about is how good the game actually is. If you have 60 FPS with a thousand bitmapData, what's the issue? However like you said, it's very likely to quickly be laggy, as those are expensive. But it all comes down to what game you're doing. If it's a simple color-the-things game, it should be okay. Also be sure to deeply test the tinting, as I think it does not work very well in canvas mode, especially on devices. Link to comment Share on other sites More sharing options...
Recommended Posts