API reference
Every public class, method, and event in @codexo/exojs. Generated from source.
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
new(options: FadeSceneTransitionOptionsOptions for FadeSceneTransition.): FadeSceneTransitionCreate a FadeSceneTransition.
Methods10
beginSession(environment: SceneTransitionEnvironmentHanded to SceneTransition.beginSession. `commitRequested`/`committed` are live views - they reflect state at read time, not a snapshot taken when this object w…): SceneTransitionSessionOne navigation's worth of mutable transition state - created fresh per navigation by SceneTransition.beginSession, driven by the Director until SceneTransition…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(): FadePhaseStateAllocate 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).
createSession(environment: SceneTransitionEnvironmentHanded to SceneTransition.beginSession. `commitRequested`/`committed` are live views - they reflect state at read time, not a snapshot taken when this object w…): SceneTransitionSessionOne navigation's worth of mutable transition state - created fresh per navigation by SceneTransition.beginSession, driven by the Director until SceneTransition…Construct this navigation's session. Override in a subclass.
destroyPhaseState(state: FadePhaseState): voidRelease 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.
enter(context: SceneTransitionPhaseContextPer-frame context handed to PhasedSceneTransition.enter/ PhasedSceneTransition.exit., state: FadePhaseState): voidDraw one frame of the enter phase. No-op by default - override for a visible enter effect.
exit(context: SceneTransitionPhaseContextPer-frame context handed to PhasedSceneTransition.enter/ PhasedSceneTransition.exit., state: FadePhaseState): voidDraw one frame of the exit phase. No-op by default - override for a visible exit effect.
Declare this phase's render-resource requirements. See SceneTransitionPhaseRequirements.
getRequirements(context: SceneTransitionContextImmutable, read-only description of the navigation a SceneTransition is being asked to run for - passed to SceneTransition.getRequirements and into the SceneTr…): SceneTransitionRequirementsRender resources a SceneTransitionSession needs, declared once up front via SceneTransition.getRequirements so the Director can provision them before the sessi…Pure, synchronous. Called once, before a session starts, so the Director can provision render resources up front.
getRequirementsForPhase(phase: "enter" | "exit", context: SceneTransitionContextImmutable, read-only description of the navigation a SceneTransition is being asked to run for - passed to SceneTransition.getRequirements and into the SceneTr…): SceneTransitionPhaseRequirementsPer-phase render-resource requirements for one phase (`enter` or `exit`) of a PhasedSceneTransition. Same shape as SceneTransitionRequirements - kept as a dist…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.
runPhase(phase: "enter" | "exit", context: SceneTransitionPhaseContextPer-frame context handed to PhasedSceneTransition.enter/ PhasedSceneTransition.exit., state: FadePhaseState): voidSession-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
The color faded to. Default Color.black.
easing: EasingFunctionplacement: "scene" | "screen"Source