SceneManager
Defined in: SceneManager.ts:27
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:119
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:129
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:124
All scenes in the stack, bottom to top.
Returns
Section titled “Returns”readonly Scene[]
autoPauseOnBlur
Section titled “autoPauseOnBlur”Get Signature
Section titled “Get Signature”get autoPauseOnBlur():
boolean
Defined in: SceneManager.ts:50
Pause all non-paused scenes when document.hidden becomes true; restore
them on focus. Default: false. Only scenes paused by this mechanism are
restored — user-paused scenes (manual scene.paused = true or pauseBelow
cascade) are never touched.
Returns
Section titled “Returns”boolean
Set Signature
Section titled “Set Signature”set autoPauseOnBlur(
value):void
Defined in: SceneManager.ts:54
Parameters
Section titled “Parameters”boolean
Returns
Section titled “Returns”void
isTransitioning
Section titled “isTransitioning”Get Signature
Section titled “Get Signature”get isTransitioning():
boolean
Defined in: SceneManager.ts:134
Whether a scene transition is currently running.
Returns
Section titled “Returns”boolean
Methods
Section titled “Methods”_destroy()
Section titled “_destroy()”_destroy():
void
Defined in: SceneManager.ts:256
Internal
Mark the manager destroyed and synchronously tear down every scene. Called by Engine.destroy(). Any queued async work short-circuits on resume; in-flight transitions’ pending promises are resolved via _cleanupRun so they don’t leak.
Returns
Section titled “Returns”void
_flushDestroyQueues()
Section titled “_flushDestroyQueues()”_flushDestroyQueues():
void
Defined in: SceneManager.ts:282
Internal
Flush destroy queues for all active scenes. Called by the engine during endOfFrame.
Returns
Section titled “Returns”void
_handleVisibilityChange()
Section titled “_handleVisibilityChange()”_handleVisibilityChange(
hidden):void
Defined in: SceneManager.ts:94
Internal
React to a visibility change. Parameterised on hidden so unit tests can
drive it without a real document.
Parameters
Section titled “Parameters”hidden
Section titled “hidden”boolean
Returns
Section titled “Returns”void
_mountDetached()
Section titled “_mountDetached()”_mountDetached(
scene):Promise<void>
Defined in: SceneManager.ts:229
Internal
Run the full scene-enter lifecycle (beforeEnter hooks, preload, onEnter) for a scene that is NOT placed on the stack. Used by infrastructure plugins like DebugPlugin that render a scene off-stack.
Parameters
Section titled “Parameters”Returns
Section titled “Returns”Promise<void>
_setContext()
Section titled “_setContext()”_setContext(
context):void
Defined in: SceneManager.ts:69
Internal
Set the engine context.
Parameters
Section titled “Parameters”context
Section titled “context”Returns
Section titled “Returns”void
_tickTransition()
Section titled “_tickTransition()”_tickTransition(
dt):void
Defined in: SceneManager.ts:293
Internal
Advance the active transition by dt ms. Called by Engine’s earlyUpdate
callback with raw (unscaled) wall-clock dt.
Parameters
Section titled “Parameters”number
Returns
Section titled “Returns”void
_unmountDetached()
Section titled “_unmountDetached()”_unmountDetached(
scene):void
Defined in: SceneManager.ts:243
Internal
Run the scene-exit lifecycle (onExit, entity destruction, afterExit hooks, scoped-service clear) for a detached scene.
Parameters
Section titled “Parameters”Returns
Section titled “Returns”void
pop(
opts?):Promise<Scene|undefined>
Defined in: SceneManager.ts:156
Pop the top scene. Scenes below may receive onResume().
Parameters
Section titled “Parameters”Returns
Section titled “Returns”Promise<Scene | undefined>
popAll()
Section titled “popAll()”popAll():
Promise<void>
Defined in: SceneManager.ts:209
Pop every scene on the stack, top to bottom. Each receives onExit(). Queued like push/pop/replace — runs after any in-flight transition. Use for “restart from menu”-style flows. Does not run transitions.
Returns
Section titled “Returns”Promise<void>
push()
Section titled “push()”push(
scene,opts?):Promise<void>
Defined in: SceneManager.ts:142
Push a scene onto the stack. Scenes below may receive onPause().
If the scene declares a preload array, assets are loaded before onEnter().
Parameters
Section titled “Parameters”Returns
Section titled “Returns”Promise<void>
replace()
Section titled “replace()”replace(
scene,opts?):Promise<void>
Defined in: SceneManager.ts:180
Replace the top scene. Without a transition the old scene exits first, then the new scene enters. With a transition the new scene is pushed first, both scenes coexist for the transition duration, then the old scene is removed at the end.
Parameters
Section titled “Parameters”Returns
Section titled “Returns”Promise<void>