API reference

Every public class, method, and event in @codexo/exojs. Generated from source.

C

classFadeSceneTransition

@codexo/exojs / core / stable

Fade to a color, switch scenes, fade back in. `placement: 'screen'`, `currentFrame: 'direct'`, `outgoingFrame: 'none'` - the live surface renders straight to the screen with no extra texture pass; `render()` only draws the overlay on top. The universal default transition.

4
props
10
methods
0
events
Import
import { FadeSceneTransition } from '@codexo/exojs'

Fade to a color, switch scenes, fade back in. `placement: 'screen'`, `currentFrame: 'direct'`, `outgoingFrame: 'none'` - the live surface renders straight to the screen with no extra texture pass; `render()` only draws the overlay on top. The universal default transition.

Constructors1
Create a FadeSceneTransition.
Methods10
Called by the Director - do not call directly. Dispatches to SceneTransition.createSession, which is protected so it does not clutter a beginner's view of a transition subclass while still being callable from Director code that does not share this class's hierarchy.
createPhaseState(): FadePhaseState
Allocate this navigation's session-scoped mutable scratch state (reused Sprite/Matrix/Color/etc - anything enter()/exit() mutates per draw). Called once per session, never shared across navigations or with the definition instance itself, which must stay fully immutable so it can be reused (even concurrently) across arbitrarily many navigations. Default: no scratch state needed (void).
destroyPhaseState(state: FadePhaseState): void
Release whatever PhasedSceneTransition.createPhaseState allocated for one navigation. Called exactly once per session, on every exit path - normal completion, an abort before the commit, or the application being destroyed mid-transition. Override it whenever the phase state owns GPU-backed resources (a Geometry, a Material, a Graphics, a RenderTexture you created yourself); plain scratch objects need no override. Textures handed in through SceneTransitionFrame are borrowed and must not be released here.
Draw one frame of the enter phase. No-op by default - override for a visible enter effect.
Draw one frame of the exit phase. No-op by default - override for a visible exit effect.
Director entry point - mirrors SceneTransition.beginSession/ createSession(): the Director (and, for { enter, exit } composition, a sibling PhasedSceneTransition instance's own session driver) calls this directly on a phase instance it doesn't own the hierarchy of, which the protected PhasedSceneTransition.getPhaseRequirements authoring hook cannot support on its own. Authors implement getPhaseRequirements(); nothing else calls it directly.
Session-driver entry point for rendering one frame of phase - mirrors PhasedSceneTransition.getRequirementsForPhase exactly: PhasedSceneTransitionSession (and, for { enter, exit } composition, a *different* PhasedSceneTransition instance's session) is not a subclass of this class and cannot call the protected PhasedSceneTransition.enter/PhasedSceneTransition.exit hooks directly. Authors override enter()/exit(); nothing else calls them directly.
Properties4
placement: "scene" | "screen"
Source