StepContext\<TConfig = `unknown`, TProfile *extends* [`SpeedProfile`](/api/interfaces/index.SpeedProfile/) = [`SpeedProfile`](/api/interfaces/index.SpeedProfile/)\>
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 Parameter | Default type |
|---|---|
TConfig | unknown |
TProfile extends SpeedProfile | SpeedProfile |
Properties#
| Property | Modifier | Type | Description | Defined in |
|---|---|---|---|---|
config | public | TConfig | What the controller handed the phase in run(config). | spin/phases/steps.ts:18 |
container | public | Container | reel.container, the thing a landing bounce moves. | spin/phases/steps.ts:21 |
gsap | public | typeof gsap | - | spin/phases/steps.ts:19 |
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:23 |
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:25 |
profile | public | TProfile | The profile the phase runs on. A 'quicken' press that named one has swapped it in. | spin/phases/steps.ts:16 |
quickened | readonly | boolean | true once a quicken has reached this phase, so a step can shorten itself. | spin/phases/steps.ts:33 |
reel | public | Reel | - | spin/phases/steps.ts:14 |
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: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#
| Parameter | Type |
|---|---|
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#
| Parameter | Type |
|---|---|
ms | number |
Returns#
Promise<void>