Jump to content

Time elapsed after tab unfocus


franmcod
 Share

Recommended Posts

  • 2 weeks later...
 this.sys.game.events.on('hidden', function () {
            
           // game.scene.keys['GameScene'].sys.sleep();
var getLeavingTime = get leaving time here;

        }, this);

        this.sys.game.events.on('visible', function () {
           
var getBackTime = get back time here; 
            // game.scene.keys['GameScene'].sys.sleep();
          
            game.scene.keys['GameScene'].sys.wake();

        }, this);

 

so the time elapsed is equal getBackTime - getLeavingTime

 

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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