Quantcast
Channel: Cocos Forums - Latest topics
Viewing all articles
Browse latest Browse all 17112

How do you manage the scenes? Navigating etc?

$
0
0

@syaifulnizamyahya wrote:

I want to create multiple menu scenes. Example, Im in main menu. i want to navigate to option menu. then i want to go back to main menu. whats the best practice here?

Maybe I create main menu scene from appdelegate. then i can create option menu and call
Director::getInstance()->replaceScene(OptionsMenuScene) from MainMenuScene class. if i want to go back, i can Director::getInstance()->replaceScene(MainMenuScene). provided that optionsmenuscene and mainmenuscene is global and already created/initialized. if for example, you would have multiple levels and each levels is a scene, it would not be nice if i have to create and initialize every levels when starting the application. it would be nice if the level scene is only created when you want to use it.

also, what happens to the scene objects that is being replaced? is it gone?

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 17112

Trending Articles