Jump to content

Phaser animation stops while switching tab


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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

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