OscarBraindeaD Posted December 22, 2014 Share Posted December 22, 2014 Hi all,i'm using phaser to make a little html5 game. I'm using states to separate the differents parts of the game.I have a question about how Phaser works internally... when I pass from one state to another one, do I must delete all sprites, buttons, etc... manually before leaving the current state or Phaser automatically delete all the sprites, buttons, I've created? Please excuse me if this has been answered already. Thanks in advance.Regards. Link to comment Share on other sites More sharing options...
lewster32 Posted December 22, 2014 Share Posted December 22, 2014 Phaser will attempt to clear the display list, so any display objects added to the world will recursively have their destroy methods called. Link to comment Share on other sites More sharing options...
OscarBraindeaD Posted December 22, 2014 Author Share Posted December 22, 2014 Perfect!Thanks for the info, Lewster. lewster32 1 Link to comment Share on other sites More sharing options...
omarojo Posted June 18, 2015 Share Posted June 18, 2015 This is not happening. I have 2 states, and when I so this.state.start('SlideShow', true,false) or any combination of that method. the previous state is still there. I can stil see all the objects being rendered on screen. Link to comment Share on other sites More sharing options...
Recommended Posts