pixi-reels

API reference

StepContext

pixi-reels


pixi-reels / index / StepContext

Defined in: spin/phases/steps.ts:13

What every step of a phase receives. The reel and the numbers a step needs, plus two ways to wait that a slam can cut: wait for time, until for a condition the reel reaches on some frame.

Type Parameters#

Type ParameterDefault type
TConfigunknown
TProfile extends SpeedProfileSpeedProfile
TStepStepTiming

Properties#

PropertyModifierTypeDescriptionDefined in
anticipatedreadonlybooleanThe reel ran an anticipation tease earlier in this spin.spin/phases/steps.ts:33
configpublicTConfigWhat the controller handed the phase in run(config).spin/phases/steps.ts:35
containerpublicContainerreel.container, the thing a landing bounce moves.spin/phases/steps.ts:38
gsappublictypeof gsap-spin/phases/steps.ts:36
mainpublic"x" | "y"The container property that is the reel’s travel axis: 'y' on a vertical set, 'x' on a horizontal one.spin/phases/steps.ts:40
phasepublicReelPhase<TConfig, TProfile>The phase running the step, for phase.land() / phase.bounce() and its protected state from a subclass.spin/phases/steps.ts:42
profilepublicTProfileThe profile the phase runs on, with the phase’s own section folded in (phase.timing). A 'quicken' press that named one has swapped it in.spin/phases/steps.ts:23
quickenedreadonlybooleantrue once a quicken has reached this phase, so a step can shorten itself.spin/phases/steps.ts:50
reelpublicReel-spin/phases/steps.ts:18
signalpublicAbortSignalAborted when a slam cuts the step, or a quicken cuts a cut step. A step that returns a promise stops its own work on it; a returned tween or bounce is cancelled for it.spin/phases/steps.ts:48
stepreadonlyreadonly TStep[]What the profile configured for THIS step, in segment order, from profile[phase].steps[name] and its whenAnticipated half. Empty when the profile says nothing. A single object in the profile arrives as one entry; the built-in steps read step[0] and a list is for a step written to consume segments.spin/phases/steps.ts:31

Methods#

until()#

until(predicate: () => boolean): Promise<void>;

Defined in: spin/phases/steps.ts:57

Resolve on the first frame predicate() is true, checked from the phase’s update(). What a spin-out waits on: not a time, a state.

Parameters#

ParameterType
predicate() => boolean

Returns#

Promise<void>


wait()#

wait(ms: number): Promise<void>;

Defined in: spin/phases/steps.ts:52

Wait ms on the gsap clock. Resolves early, aborted, when the step is cut.

Parameters#

ParameterType
msnumber

Returns#

Promise<void>