Jump to content

how to keep updating when iframe loses focus?


Tweeper
 Share

Recommended Posts

I'm running a game html document, made in Phaser, from within an iframe.

To my surprise when the iframe loses focus (on the same browsertab), Phaser stops updating.

I can see the render-event still got fired, but not the update-event.

 

I'm surprised by this. Normaly I use Greensock tick events together with PIXIjs, or easelJS onTick function, and there I never had this problem; both always got fired, independent of the iframe focus.

 

I understand Request Animation Frame isn't raised if the browsertab/window isn't active and that's fine with me. But I want both the rendering and updating to continue if the same tab remains active and the iframe loses it focus too.

 

I just recently switched to Phaser, so please forgive me if this is a silly question, but am I missing something here? Is there some setting in phaser I can set to true to prevent the update-event from being stopped when the iframe, handling the gamedocument with canvas, loses focus?

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.

Guest
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.

Loading...
 Share

  • Recently Browsing   0 members

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