charlie_says Posted November 21, 2016 Share Posted November 21, 2016 I have a couple of large PNGs which I'm loading and then changing the colour of using shiftHSL. It works fine, but because the PNGs are so large, it's pretty slow. I've pulled it out of the main game, so the colouring happens after the game is loaded rather than trying to do it when the game builds, but, if you click play too quickly, it hasn't finished. Is there a way I can set some sort of callback so I can prevent the player moving on before it's complete? Link to comment Share on other sites More sharing options...
samme Posted November 21, 2016 Share Posted November 21, 2016 You could create a Phaser.Signal and dispatch it once the function finishes. You could dedicate a whole State to the coloring. Check progress during update() and then start the play state once complete. Link to comment Share on other sites More sharing options...
charlie_says Posted November 22, 2016 Author Share Posted November 22, 2016 Thanks @samme, I like the idea of having a state that does the colouring (I'm not quite certain how I could use update to monitor the progress, but, I'll have a think about it.) And, the Phaser.Signal is a good call. Link to comment Share on other sites More sharing options...
Recommended Posts