charlie_says Posted November 28, 2017 Share Posted November 28, 2017 I'v got a really odd issue, which happens the same way in multiple versions of phaser (definitely 2.6.2 & 2.9.2) I am using bitmap text, which works fine when I play the game first time around, but, bizarrely when the game ends & restarts the text disappears. It's used on the splash screen, and this problem isn't replicated there (i.e. every time you go back it appears!) Any ideas? Link to comment Share on other sites More sharing options...
charlie_says Posted November 28, 2017 Author Share Posted November 28, 2017 Further investigation has shown bitmapText is working fine... What doesn't work is adding loops via game.time.events on multiple plays (works first time, not on subsequent.) Link to comment Share on other sites More sharing options...
samme Posted November 28, 2017 Share Posted November 28, 2017 14 minutes ago, charlie_says said: What doesn't work is adding loops via game.time.events on multiple plays (works first time, not on subsequent.) Strange. How are you restarting? Link to comment Share on other sites More sharing options...
charlie_says Posted November 28, 2017 Author Share Posted November 28, 2017 By moving between states... I basically follow this example: https://phaser.io/examples/v2/time/basic-looped-event altho, like this this.timer = game.time.events; this.gameTimer = this.timer.loop(100, this.updateTimer, this ); so, I can stop... <edit!> I just worked it out... I pass the events to variables so I can stop the timer when the game is over. Obviously as the timer is not (re)started, it doesn't work later. GAH! Link to comment Share on other sites More sharing options...
samme Posted November 28, 2017 Share Posted November 28, 2017 Timer events are cleared when changing states (or restarting). But you should be able to create/start a new loop event with no problem. Link to comment Share on other sites More sharing options...
Recommended Posts