pixi-reels

StepContext\<TConfig = `unknown`, TProfile *extends* [`SpeedProfile`](/api/interfaces/index.SpeedProfile/) = [`SpeedProfile`](/api/interfaces/index.SpeedProfile/)\>

pixi-reels


pixi-reels / index / StepContext

Interface: StepContext<TConfig = unknown, TProfile extends SpeedProfile = SpeedProfile>

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

Properties#

PropertyModifierTypeDescriptionDefined in
configpublicTConfigWhat the controller handed the phase in run(config).spin/phases/steps.ts:18
containerpublicContainerreel.container, the thing a landing bounce moves.spin/phases/steps.ts:21
gsappublictypeof gsap-spin/phases/steps.ts:19
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:23
phasepublicReelPhase<TConfig, TProfile>The phase running the step, for phase.land() / phase.bounce() and its protected state from a subclass.spin/phases/steps.ts:25
profilepublicTProfileThe profile the phase runs on. A 'quicken' press that named one has swapped it in.spin/phases/steps.ts:16
quickenedreadonlybooleantrue once a quicken has reached this phase, so a step can shorten itself.spin/phases/steps.ts:33
reelpublicReel-spin/phases/steps.ts:14
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:31

Methods#

until()#

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

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

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:35

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

Parameters#

ParameterType
msnumber

Returns#

Promise<void>