How do I switch scenes?

? Both constructors take the scene to work with as a parameter:

[…] Ah, I understand, you want to move some existing assets from one scene to another… Not sure it is possible. However, in your case, why don’t you load directly your assets in the main scene? Even if all the assets are not loaded yet, it won’t stop the scene to be rendered correctly with the assets already available.

You can load your assets (the ones you want to load in “GameplayScene”) in “HomeScene” first, then wait for them to be loaded, then load your other assets. No need for two scenes for that.

2 Likes

Yes, I can use different AssetContainers and/or AssetsManagers for different scenes, but then the player will need to wait for the “GameplayScene” to load assets.

What I want:

  1. All the assets used in the “GameplayScene” are loaded at the start of the game (along with the few other assets used in “HomeScene”).
  2. After the assets are loaded, “HomeScene” is shown.
  3. When the player clicks the “Play” button, after a short transition effect the “GameplayScene” is shown (without any time spent to load the assets, cause they are already loaded).

Perhaps I should create both “HomeScene” and “GameplayScene” at the start of the game and when assets are loaded, only render “HomeScene”? I’ll keep a reference to the “GameplayScene” and when the player clicks the “Play” button, I’ll take out “HomeScene” and render “GameplayScene” instead.

Is this the recommended way to do this kind of task?

2 Likes

Yup I would do that as it could be easier to track what is going on in your use case.

1 Like

Exactly! :slight_smile: Glad I made sense… it was late when I responded and my brain was on meltdown.

2 Likes

Thanks for your help with this @Deltakosh . It’s been almost a year but I thought you might want to see what I made thanks to your help with this thread and various other technical questions I had. 3d kids game to help teach kids to read. - YouTube . It’s an Android app.

I greatly appreciate everyone’s help but especially yours Deltakosh, thank you.