Jump to content

Short way to removeAll() from state before switch?


KevinnFtw
 Share

Recommended Posts

Hey guys,

 

I'm having some issues switching between states.

In the first run it all works fine, but then when I come back to a state I've already been at, like MainMenu, the design is all messed up.

 

I think it is because not all sprites and stuff are removed when I switch states, that's why I added a this.world.removeAll() in my shutdown function.

However that doesn't seem to do anything.

 

Is there another short way to delete everything (except cache) from a state before switching to another state, or does it have to be done manually?

 

I've attached 2 images, one of my MainMenu first time, and one of the MainMenu when I switch back to it (after the Game).

 

Excuse me if it is a silly question, I've just recently started using states..

 

Thanks,

Kevin

post-8191-0-97490500-1401651831_thumb.pn

post-8191-0-36780900-1401651832_thumb.pn

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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