Jump to content

Short way to removeAll() from state before switch?


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 post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...