pixi-wheels

WheelEvents

pixi-wheels


pixi-wheels / index / WheelEvents

Interface: WheelEvents

Defined in: events/WheelEvents.ts:19

Every event a wheel emits. One emitter per wheel; every payload names the ring it came from ('main' for single-ring wheels), so a two-ring wheel needs no second subscription.

Audio, particles, Spine reactions and HUD updates hang off these. Every exit path from a spin (normal stop, skip, slam, destroy) fires the right events, so listening once keeps a game correct on all of them.

Extends#

  • Record<string, unknown[]>

Indexable#

[key: string]: unknown[]

Properties#

PropertyTypeDescriptionDefined in
anticipation:bait[{ bait: ResolvedSection; ring: string; }]The pointer reached the bait section’s edge: the moment of maximum hope.events/WheelEvents.ts:45
anticipation:end[{ bait: ResolvedSection; ring: string; }]The tease resolved into the real landing.events/WheelEvents.ts:47
anticipation:start[{ bait: ResolvedSection; ring: string; style: AnticipationStyle; }]A tease was planned. bait is the section the player is meant to hope for.events/WheelEvents.ts:43
destroyed[]The wheel was destroyed. Every listener is dropped after this fires.events/WheelEvents.ts:83
idle:start[{ direction: SpinDirection; ring: string; speed: number; }]The ring began its idle rotation.events/WheelEvents.ts:68
idle:stop[{ ring: string; }]The ring stopped idling.events/WheelEvents.ts:70
pointer:tick[{ direction: SpinDirection; from: ResolvedSection; pointer: string; ring: string; speed: number; to: ResolvedSection; }]A section divider passed under a pointer. Fires once per divider, in order, at any speed - the natural hook for the ratchet click. speed is the ring’s angular speed (deg/s) at the crossing.events/WheelEvents.ts:53
sections:changed[{ ring: string; sections: readonly ResolvedSection[]; step: number | null; }]Section weights changed. Fires once for a snap change, and once at the end of an animated transition. Labels and skins have already re-laid out.events/WheelEvents.ts:75
sections:transition:end[{ ring: string; step: number | null; }]An animated weight transition ended.events/WheelEvents.ts:79
sections:transition:start[{ durationMs: number; ring: string; step: number | null; }]An animated weight transition began.events/WheelEvents.ts:77
skip:completed[{ ring: string; }]The fast-forward finished and the ring is on its landing angle.events/WheelEvents.ts:66
skip:requested[{ protectedByAnticipation: boolean; ring: string; }]A skip was accepted and the fast-forward is about to begin.events/WheelEvents.ts:64
speed:changed[{ name: string; previous: string; profile: SpinProfile; ring: string; }]setSpeed() switched the active profile.events/WheelEvents.ts:81
spin:complete[WheelSpinResult]The spin is over and its promise has resolved.events/WheelEvents.ts:41
spin:cruise[{ ring: string; speed: number; }]The ring reached cruise speed and is waiting for a result.events/WheelEvents.ts:23
spin:landing[{ landingAngle: number; ring: string; section: ResolvedSection; }]The pointer reached the landing angle. The section is decided; a settle move (center / bounce) may still follow. Cue the sector-win reveal.events/WheelEvents.ts:35
spin:resultSet[{ ring: string; target: ResolvedTarget; }]setResult() resolved a target. Fires before any deceleration is planned.events/WheelEvents.ts:25
spin:settle:end[{ ring: string; }]A settle move ended.events/WheelEvents.ts:39
spin:settle:start[{ mode: "center" | "bounce"; ring: string; }]A settle move began.events/WheelEvents.ts:37
spin:start[{ direction: SpinDirection; fromIdle: boolean; ring: string; }]spin() was called. fromIdle is true when the ring was already turning.events/WheelEvents.ts:21
spin:stopping[{ anticipation: AnticipationStyle | null; duration: number; ring: string; turns: number; }]The deceleration begins. turns is how many full turns the plan makes, duration how long it will take in ms. Cue the “slowing down” audio here.events/WheelEvents.ts:30