Jump to content

Phaser animation stops while switching tab


rado9408
 Share

Recommended Posts

I have started using phaser 3 as a game development library,  but  sometimes I am facing some huge problems , for example,  not playing animations on the background mode. When I am switching the tab the animation is starting to play. My expected result is to play animations on the background mode. Is there any solution for this  or is there any other solution  beside playing animations ???
Link to comment
Share on other sites

If you switch tab, or minimize the browser, or even just cover the browser window up with another app, then the browser will start to slow anything using Request Animation Frame down, and eventually, it will stop updating it completely. It does this automatically, it's nothing to do with Phaser and you cannot prevent it.

All you can do is detect if it happens and code your game in such a way that you deal with it when you return. If this means fast-forwarding animations ahead to make up for the 'lost' time, then so be it, but that's your call, there is no way Phaser can do it for you.

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...