1681-engine / index / transitionTo
Function: transitionTo() ​
ts
function transitionTo(
engine,
next,
transition,
mode?
): Promise<void>;Defined in: src/transitions/transitionTo.ts:21
Changes scene behind a transition: covers the screen, runs engine.scenes.replace(next) (or push, or pop, for which next is ignored) — waiting out an async onEnter while covered — then reveals. Resolves when the reveal ends. The overlay is removed and the transition disposed even when the scene change throws, which is re-thrown.
ts
await transitionTo(engine, new Level2(), new FadeTransition({ duration: 250 }));Parameters ​
| Parameter | Type | Default value |
|---|---|---|
engine | Engine | undefined |
next | Scene | null | undefined |
transition | Transition | undefined |
mode | TransitionMode | 'replace' |
Returns ​
Promise<void>