isfuturebright Posted November 1, 2013 Share Posted November 1, 2013 I was wondering if I could do something like "game.state.stack("PausePopUp") " so this state would run on top of the previous one. Is there a simple way of doing this in Phaser? Link to comment Share on other sites More sharing options...
rich Posted November 1, 2013 Share Posted November 1, 2013 Nope, we need some deeper internal changes to the way states are handled to be able to do this. There's a discussion on this subject elsewhere on the forum. Link to comment Share on other sites More sharing options...
Chris Posted November 1, 2013 Share Posted November 1, 2013 In the meantime, you could put all sprites and buttons of your pause popup into a sprite group and show/hide that group. isfuturebright 1 Link to comment Share on other sites More sharing options...
onedayitwillmake Posted November 2, 2013 Share Posted November 2, 2013 The way I am handling this for my current game is not, really how I'm sure phase is meant to be used however it is the only way to achieve this for now.I only use a single "real" phaser state, which acts as my StateMachine. The state machine allows a previous state to exist, and can pop back to it. Every state has an onEnter onUpdate, onExit and destroy method. onUpdate is only called on the currentState and destroy is called once a say a third state is pushed the first one will be destroyed and the second will become previousStateThis works quiet well, and I have experienced no issues with this paradigm existing on top of phaser. isfuturebright and RestingCoder 2 Link to comment Share on other sites More sharing options...
isfuturebright Posted November 4, 2013 Author Share Posted November 4, 2013 Thanks guys! Will probably try the Group approach! Link to comment Share on other sites More sharing options...
Recommended Posts