casey Posted January 31, 2018 Share Posted January 31, 2018 I have a popup on pause that contains some functions that require an update, so I'm pausing the game and trying to use pauseUpdate but it's not running (no error thrown, just not updating). Can someone explain pauseUpdate and how to use it? Link to comment Share on other sites More sharing options...
samme Posted January 31, 2018 Share Posted January 31, 2018 Make sure it's definitely in the state object. console.assert( 'pauseUpdate' in game.state.getCurrentState() ); There shouldn't be much else to do. Link to comment Share on other sites More sharing options...
casey Posted January 31, 2018 Author Share Posted January 31, 2018 Thanks. I'm trying to read pointer data in the pause state, but the pointer data isn't being logged or is freezing (constantly reading as "down is true" according to debug). Link to comment Share on other sites More sharing options...
samme Posted January 31, 2018 Share Posted January 31, 2018 In mine the pointer continues getting updates while paused (see pen, updated). Link to comment Share on other sites More sharing options...
casey Posted February 1, 2018 Author Share Posted February 1, 2018 Thanks, but can you explain to me why my pointerinfo on render is not updating when this testscreen is paused? var testpause = { preload: function(){ this.game.stage.backgroundColor = '#FFF'; this.game.load.image('pause', 'pause.png'); }, create: function(){ this.pause = this.game.add.button(100, 100, 'pause', this.managePause, this); }, managePause: function() { if(!this.game.paused){ this.game.paused = true; console.log("game paused"); } else(this.game.paused = false); console.log("game not paused"); }, render: function(){ game.debug.pointer( game.input.activePointer ); } } Link to comment Share on other sites More sharing options...
casey Posted February 2, 2018 Author Share Posted February 2, 2018 Nobody? Link to comment Share on other sites More sharing options...
samme Posted February 2, 2018 Share Posted February 2, 2018 I don't see anything wrong with it. Capitaine Herlock 1 Link to comment Share on other sites More sharing options...
casey Posted February 2, 2018 Author Share Posted February 2, 2018 39 minutes ago, samme said: I don't see anything wrong with it. Thanks--the code looks fine to me, too, but when I run it, the pointer data doesn't update on pause. Link to comment Share on other sites More sharing options...
Capitaine Herlock Posted February 2, 2018 Share Posted February 2, 2018 Does the book Interphase1 explains how to manage pause in an #PhaserJS manner or it's from scratch, because the example of @samme answers the question of how to pause in an easy manner Link to comment Share on other sites More sharing options...
casey Posted February 2, 2018 Author Share Posted February 2, 2018 16 minutes ago, Capitaine Herlock said: Does the book Interphase1 explains how to manage pause in an #PhaserJS manner or it's from scratch, because the example of @samme answers the question of how to pause in an easy manner I'm sorry, but I don't understand what you're saying. I'm trying to find out why my code doesn't work. Link to comment Share on other sites More sharing options...
Recommended Posts