Jump to content

Phaser browser Next Tab Update is stopped


Recommended Posts

In Phaser i use ES5,

 

this is my boot state.

------------------------------------

var initGame = function(game) {};

initGame.prototype =
{
    init: function()
    {
        console.log("INIT GAME");
        this.scale.scaleMode = Phaser.ScaleManager.SHOW_ALL;
        this.game.stage.disableVisibilityChange = true;
    },

    preload:function ()
    {
        console.log("Preload");
        
    },
    create:function ()
    {        
        game.state.start("STAGE_ASSETS");
    },
}

------------------------------------------------------------------------------------------------------------------------------------------------------

This is My Second State-

-----------------------------------------

var stageAssets = function ()
{
     i =0;
}

stageAssets.prototype =
{
    create: function ()
    {
        console.log("STAGE ASSETS");
    },

    update: function ()
    {
        wheel.angle +=1;
        console.log("----------------i----->"+i++);
    },

}

In this game i just trace i in update, In browser i just move to next tab update is stopped, I also put

Quote

this.game.stage.disableVisibilityChange = true;

In my boot state, still Update is not Working when i minimize window or move to next tab, update is stopped. In my game i put some main functions in update. that function are not working at that time. I google is lots of time, still no one give solution. Please Help us rectify this problem.

Link to post
Share on other sites
18 hours ago, prob said:

In regards to your timer, you could incorporate logic to use a starting timestamp, getting the current time, and comparing the difference to a set value (limit):


var date = new Date();
var timestamp = date.getTime();

Thanks. But How to get browser focus and Out focus, in Phaser CE v2.10.0

 

Link to post
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...
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...