API reference
StepContext
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 Parameter | Default type |
|---|---|
TConfig | unknown |
TProfile extends SpeedProfile | SpeedProfile |
TStep | StepTiming |
Properties#
| Property | Modifier | Type | Description | Defined in |
|---|---|---|---|---|
anticipated | readonly | boolean | The reel ran an anticipation tease earlier in this spin. | spin/phases/steps.ts:33 |
config | public | TConfig | What the controller handed the phase in run(config). | spin/phases/steps.ts:35 |
container | public | Container | reel.container, the thing a landing bounce moves. | spin/phases/steps.ts:38 |
gsap | public | typeof gsap | - | spin/phases/steps.ts:36 |
main | public | "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 |
phase | public | ReelPhase<TConfig, TProfile> | The phase running the step, for phase.land() / phase.bounce() and its protected state from a subclass. | spin/phases/steps.ts:42 |
profile | public | TProfile | The 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 |
quickened | readonly | boolean | true once a quicken has reached this phase, so a step can shorten itself. | spin/phases/steps.ts:50 |
reel | public | Reel | - | spin/phases/steps.ts:18 |
signal | public | AbortSignal | Aborted 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 |
step | readonly | readonly 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#
| Parameter | Type |
|---|---|
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#
| Parameter | Type |
|---|---|
ms | number |
Returns#
Promise<void>