Skip to content

SceneManager

Defined in: SceneManager.ts:8

Stack-based scene manager with push/pop/replace semantics.

new SceneManager(): SceneManager

SceneManager

get active(): Scene | undefined

Defined in: SceneManager.ts:27

The topmost (active) scene.

Scene | undefined


get activeScenes(): readonly Scene[]

Defined in: SceneManager.ts:37

All non-paused scenes in the stack, bottom to top.

readonly Scene[]


get all(): readonly Scene[]

Defined in: SceneManager.ts:32

All scenes in the stack, bottom to top.

readonly Scene[]

_flushDestroyQueues(): void

Defined in: SceneManager.ts:151

Internal

Flush destroy queues for all active scenes. Called by the engine during endOfFrame.

void


_setContext(context): void

Defined in: SceneManager.ts:18

Internal

Set the engine context.

EngineContext

void


clear(): void

Defined in: SceneManager.ts:136

Clear all scenes. Each receives onExit() from top to bottom.

void


pop(): Scene | undefined

Defined in: SceneManager.ts:71

Pop the top scene. Scenes below may receive onResume().

Scene | undefined


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.

Scene

Promise<void>


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).

Scene

Promise<void>