SceneManager¶
Qualified name: algan.scene\_manager.SceneManager
- class SceneManager[source]¶
Bases:
SingletonMaintain the stack of active
Sceneobjects.SceneManager.instance()returns the manager (not a Scene). Access the topmost scene throughcurrent_scene. A default scene is created lazily when the stack is empty, preserving Algan’s traditional module-level authoring style while allowing nested, isolated scenes.Methods
Temporarily make
scenecurrent while preserving the stack.Push
sceneand make it active.Discard every scene and return a fresh default active scene.
set_scene_classPop
scenefrom the stack.Attributes
Return the topmost active scene, creating the default lazily.
An immutable snapshot of the active-scene stack.
- activating(scene)[source]¶
Temporarily make
scenecurrent while preserving the stack.This is used for scene-owned callbacks such as custom initializers when an explicit, currently inactive scene is reset or rendered.
- property current_scene¶
Return the topmost active scene, creating the default lazily.
- push(scene)[source]¶
Push
sceneand make it active.A scene may occur at most once in the stack. Re-entering an already active scene is therefore a no-op; reactivating an inactive scene moves it to the top.
- classmethod reset()[source]¶
Discard every scene and return a fresh default active scene.
This retains the singleton manager object itself; only its scene stack is reset. Existing scene references remain valid objects but are marked terminated and no longer receive implicitly-created mobs.
- property scene_stack¶
An immutable snapshot of the active-scene stack.