This site requires JavaScript, please enable it in your browser!
Greenfoot back
programmer22
programmer22 wrote ...

2014/6/19

Clear World

programmer22 programmer22

2014/6/19

#
I am trying to make a menu panel and when it is clicked to have it clear the world than produce the next panel that i want. Does anyone have the code to clear the world or is there a different approach than what i am thinking?
danpost danpost

2014/6/19

#
'getObjects(null)' will get a list of all objects currently in a world; so, 'removeObjects(getObjects(null))' will cause all objects in the world to be removed. Then, you just need to maybe change the background image and add your menu objects.
danpost danpost

2014/6/19

#
The different approach would be to make your menu out of a different world class and then set it as the active world.
You need to login to post a reply.