rodrigezer Posted November 28, 2013 Share Posted November 28, 2013 Hello.Canvas loop auto pause when the page are in focus, but when i'm in other page or minimize the chrome the loop game is in auto puase, is there a way to change it? i want to keep looping all time. TY Link to comment Share on other sites More sharing options...
rich Posted November 28, 2013 Share Posted November 28, 2013 game.stage.disableVisibilityChange = true; Link to comment Share on other sites More sharing options...
rodrigezer Posted November 28, 2013 Author Share Posted November 28, 2013 Sorry, but i'm new with phaseHow can i aply? var canvasW=800;var canvasH=650;var opt={ preload: preload, create: create, update:update };var game = new Phaser.Game(canvasW, canvasH, Phaser.CANVAS, 'game',opt);game.stage.disableVisibilityChange = true; // here give me errorsfunction preload() { game.load.image('control_panel', '/assets/control_panel.png');}function create() { game.add.sprite(0, 0, 'control_panel');}function update(){console.log('update')} Link to comment Share on other sites More sharing options...
rodrigezer Posted November 28, 2013 Author Share Posted November 28, 2013 And in wich case i need use? "Stage"?because in your examples. you just use new Phaser.Game(...) Link to comment Share on other sites More sharing options...
rodrigezer Posted November 28, 2013 Author Share Posted November 28, 2013 game.stage.disableVisibilityChange = true;Sorry, but i'm new with phaseHow can i aply? var canvasW=800;var canvasH=650;var opt={ preload: preload, create: create, update:update };var game = new Phaser.Game(canvasW, canvasH, Phaser.CANVAS, 'game',opt);game.stage.disableVisibilityChange = true; // here give me errorsfunction preload() { game.load.image('control_panel', '/assets/control_panel.png');}function create() { game.add.sprite(0, 0, 'control_panel');}function update(){console.log('update')}And in wich case i need use? "Stage"?because in your examples. you just use new Phaser.Game(...) Link to comment Share on other sites More sharing options...
rodrigezer Posted November 28, 2013 Author Share Posted November 28, 2013 Sorry, but i'm new with phaseHow can i aply? var canvasW=800;var canvasH=650;var opt={ preload: preload, create: create, update:update };var game = new Phaser.Game(canvasW, canvasH, Phaser.CANVAS, 'game',opt);game.stage.disableVisibilityChange = true; // here give me errorsfunction preload() { game.load.image('control_panel', '/assets/control_panel.png');}function create() { game.add.sprite(0, 0, 'control_panel');}function update(){console.log('update')}And in wich case i need use? "Stage"?because in your examples. you just use new Phaser.Game(...) Ohhhhhhhhhhhhhhhhh !"i seee how it work !! function preload() {game.stage.backgroundColor = '#007236';game.stage.disableVisibilityChange = true; game.load.image('control_panel', '/assets/control_panel.png');} Link to comment Share on other sites More sharing options...
Recommended Posts