Jump to content

how to keep updating when iframe loses focus?


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


  • Recently Browsing   0 members

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