KevinnFtw

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

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.