SceneManager
Defined in: SceneManager.ts:8
Stack-based scene manager with push/pop/replace semantics.
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new SceneManager():
SceneManager
Returns
Section titled “Returns”SceneManager
Accessors
Section titled “Accessors”active
Section titled “active”Get Signature
Section titled “Get Signature”get active():
Scene|undefined
Defined in: SceneManager.ts:27
The topmost (active) scene.
Returns
Section titled “Returns”Scene | undefined
activeScenes
Section titled “activeScenes”Get Signature
Section titled “Get Signature”get activeScenes(): readonly
Scene[]
Defined in: SceneManager.ts:37
All non-paused scenes in the stack, bottom to top.
Returns
Section titled “Returns”readonly Scene[]
Get Signature
Section titled “Get Signature”get all(): readonly
Scene[]
Defined in: SceneManager.ts:32
All scenes in the stack, bottom to top.
Returns
Section titled “Returns”readonly Scene[]
Methods
Section titled “Methods”_flushDestroyQueues()
Section titled “_flushDestroyQueues()”_flushDestroyQueues():
void
Defined in: SceneManager.ts:151
Internal
Flush destroy queues for all active scenes. Called by the engine during endOfFrame.
Returns
Section titled “Returns”void
_setContext()
Section titled “_setContext()”_setContext(
context):void
Defined in: SceneManager.ts:18
Internal
Set the engine context.
Parameters
Section titled “Parameters”context
Section titled “context”Returns
Section titled “Returns”void
clear()
Section titled “clear()”clear():
void
Defined in: SceneManager.ts:136
Clear all scenes. Each receives onExit() from top to bottom.
Returns
Section titled “Returns”void
pop():
Scene|undefined
Defined in: SceneManager.ts:71
Pop the top scene. Scenes below may receive onResume().
Returns
Section titled “Returns”Scene | undefined
push()
Section titled “push()”push(
scene):Promise<void>
Defined in: SceneManager.ts:46
Push a scene onto the stack. Scenes below may receive onPause().
If the scene declares a preload array, assets are loaded before onEnter().
Await the returned promise when using preloaded scenes.
Parameters
Section titled “Parameters”Returns
Section titled “Returns”Promise<void>
replace()
Section titled “replace()”replace(
scene):Promise<void>
Defined in: SceneManager.ts:93
Replace the top scene. Old scene receives onExit(). New scene receives onEnter() (after preload, if declared).
Parameters
Section titled “Parameters”Returns
Section titled “Returns”Promise<void>