1

Is there a standard way to change between scenes in Minko? Specifically, I'm imagining each scene as a different level, and when the user completes some task the entire level changes.

I know I could just update all my meshes and whatnot but this feels poor; is there a way I can build a root node for a new scene and then switch the Canvas to using that root node instead (as well as force a rererender, since all the objects will have changed)?

Ben Stott
  • 2,218
  • 17
  • 23

1 Answers1

1

Your second idea is fine. You can create a separate root Node with its own SceneManager sharing the Canvas. Add your new scene to this Node. When you're ready to switch, change the SceneManager you use in the enterFrame signal to render. This should trigger a re-render, upload textures, calls component added signals...

In Minko, there is no global singleton or anything that would prevent from having to completely separate scenes. Each SceneManager will reference its own AssetLibrary. This way, if you switch scenes and remove references to the previous SceneManager, the assets will be released from memory.

Warren Seine
  • 2,311
  • 2
  • 25
  • 38
  • So effectively the hierarchy contains the `Canvas`, a root `Node`, and then multiple level `Node`s + `SceneManager`s attached to those nodes which I can selectively add/remove as children of the root `Node`? – Ben Stott Mar 19 '15 at 23:20
  • I'm not sure that'd work because `SceneManager` are expected at the top of the hierarchy. I'd edit the answer to clarify. – Warren Seine Mar 25 '15 at 10:17