SpineReelSymbol
pixi-reels / spine / SpineReelSymbol
Class: SpineReelSymbol
Defined in: spine/SpineReelSymbol.ts:66
ReelSymbol implementation using Spine 2D skeletons.
Caches one Spine instance per symbolId for instant swapping, plays idle on
activate, and exposes the canonical set of one-shot animations (landing,
win, out, reactions). Modeled on the Bonanza / Hold & Win slot-game
conventions. drop in any skeleton that follows the same vocabulary.
Import from the pixi-reels/spine subpath so non-Spine consumers can
tree-shake this module and @esotericsoftware/spine-pixi-v8 out of their
production bundle:
import { SpineReelSymbol } from 'pixi-reels/spine';
Extends
Constructors
Constructor
new SpineReelSymbol(options: SpineReelSymbolOptions): SpineReelSymbol;
Defined in: spine/SpineReelSymbol.ts:79
Parameters
| Parameter | Type |
|---|---|
options | SpineReelSymbolOptions |
Returns
SpineReelSymbol
Overrides
Properties
| Property | Modifier | Type | Description | Inherited from | Defined in |
|---|---|---|---|---|---|
view | readonly | Container | The PixiJS container that holds this symbol’s visual. | ReelSymbol.view | symbols/ReelSymbol.ts:37 |
Accessors
isDestroyed
Get Signature
get isDestroyed(): boolean;
Defined in: symbols/ReelSymbol.ts:50
Returns
boolean
Inherited from
spine
Get Signature
get spine(): Spine | null;
Defined in: spine/SpineReelSymbol.ts:280
Access the underlying Spine. for advanced needs (reactions, events).
Returns
Spine | null
symbolId
Get Signature
get symbolId(): string;
Defined in: symbols/ReelSymbol.ts:46
Returns
string
Inherited from
Methods
activate()
activate(symbolId: string): void;
Defined in: symbols/ReelSymbol.ts:59
Activate the symbol with a new identity. Called when the symbol enters the visible reel or is recycled from the pool. Resets container transform / filter state for parity with deactivate().
Parameters
| Parameter | Type |
|---|---|
symbolId | string |
Returns
void
Inherited from
deactivate()
deactivate(): void;
Defined in: symbols/ReelSymbol.ts:75
Deactivate the symbol before returning it to the pool. Stops animations, hides the view, and resets container transform / filter state so subclass decorations don’t leak across recycles.
Returns
void
Inherited from
destroy()
destroy(): void;
Defined in: symbols/ReelSymbol.ts:92
Returns
void
Inherited from
onActivate()
protected onActivate(symbolId: string): void;
Defined in: spine/SpineReelSymbol.ts:115
Subclass hook: set up visuals for the given symbolId.
Parameters
| Parameter | Type |
|---|---|
symbolId | string |
Returns
void
Overrides
onDeactivate()
protected onDeactivate(): void;
Defined in: spine/SpineReelSymbol.ts:143
Subclass hook: clean up visuals.
Returns
void
Overrides
onDestroy()
protected onDestroy(): void;
Defined in: spine/SpineReelSymbol.ts:371
Subclass hook: additional cleanup on destroy.
Returns
void
Overrides
onReelLanded()
onReelLanded(): void;
Defined in: spine/SpineReelSymbol.ts:103
Lifecycle hook: the owning reel has landed on its final symbols. Default: no-op. Override (e.g. SpineReelSymbol.autoPlayLanding) to fire a landing animation concurrently with the bounce.
Returns
void
Overrides
onReelSpinEnd()
onReelSpinEnd(): void;
Defined in: spine/SpineReelSymbol.ts:99
Lifecycle hook: the owning reel is about to stop (just before bounce). Default: no-op.
Returns
void
Overrides
onReelSpinStart()
onReelSpinStart(): void;
Defined in: spine/SpineReelSymbol.ts:95
Lifecycle hook: the owning reel has started spinning. Default: no-op. Override (e.g. SpineReelSymbol.autoPlayBlur) to swap to a blur animation automatically.
Returns
void
Overrides
playBlur()
playBlur(): void;
Defined in: spine/SpineReelSymbol.ts:255
Swap the primary track to the blur animation for the SPIN phase. Reverts
to idle automatically on stopAnimation() or next activate.
If a one-shot promise (playWin / playLanding / playOut) is in
flight on the same track, settle it first so the caller’s await
doesn’t dangle when its track is hijacked.
Returns
void
playDestroy()
playDestroy(opts?: {
delay?: number;
signal?: AbortSignal;
}): Promise<void>;
Defined in: spine/SpineReelSymbol.ts:191
Cascade-destruction override. If the skeleton has the configured
out (disintegration) animation, play it. Otherwise fall back to the
base class’s GSAP scale-and-fade so a partial skeleton still cascades
cleanly. opts.delay is honored (seconds, mirrors the GSAP version)
so callers can stagger a winning cluster. opts.signal aborts
the (pre-delay or in-flight) animation early. the spine state is
snapped to the next track entry and the resolve fires immediately;
the view is left at alpha: 0 for parity with the GSAP fallback so
the destroyed pose is consistent across symbol kinds.
Parameters
| Parameter | Type |
|---|---|
opts? | { delay?: number; signal?: AbortSignal; } |
opts.delay? | number |
opts.signal? | AbortSignal |
Returns
Promise<void>
Overrides
playLanding()
playLanding(): Promise<void>;
Defined in: spine/SpineReelSymbol.ts:168
Play the landing animation (one-shot). Call this when the reel settles.
typically inside a spin:reelLanded listener.
Returns
Promise<void>
playOnTrack()
playOnTrack(
track: number,
animName: string,
loop?: boolean): TrackEntry | null;
Defined in: spine/SpineReelSymbol.ts:264
Play an arbitrary animation on a given track. Non-blocking.
Parameters
| Parameter | Type | Default value |
|---|---|---|
track | number | undefined |
animName | string | undefined |
loop | boolean | false |
Returns
TrackEntry | null
playOut()
playOut(): Promise<void>;
Defined in: spine/SpineReelSymbol.ts:176
Play the exit / disintegrate animation. Returns a promise that resolves when it completes. Use in cascades instead of the default alpha fade.
Returns
Promise<void>
playWin()
playWin(): Promise<void>;
Defined in: spine/SpineReelSymbol.ts:160
Play the win animation on track 0. Returns when it completes.
Returns
Promise<void>
Overrides
reset()
reset(): void;
Defined in: symbols/ReelSymbol.ts:88
Pool reset. aliases deactivate.
Returns
void
Inherited from
resize()
resize(width: number, height: number): void;
Defined in: spine/SpineReelSymbol.ts:360
Resize the symbol’s visual to fit the given dimensions.
Parameters
| Parameter | Type |
|---|---|
width | number |
height | number |
Returns
void
Overrides
stopAnimation()
stopAnimation(): void;
Defined in: spine/SpineReelSymbol.ts:270
Immediately stop any running animation and return to idle.
Returns
void