SymbolSpotlight
pixi-reels / index / SymbolSpotlight
Class: SymbolSpotlight
Defined in: spotlight/SymbolSpotlight.ts:60
The “we just won” visual primitive.
The spotlight is what turns a landed grid into a celebration. Given a list of winning cell positions, it:
- Fades in the dim overlay behind everything (everything that is not winning visually sinks into the background).
- Re-parents each winning
ReelSymbolinto the viewport’s spotlight layer so its animation isn’t clipped by the reel mask. - Calls
playWin()on each winner (your symbol class’s one-shot). - When you call
hide()or the cycle ends, it puts every symbol back where it came from and removes the dim overlay.
Two modes:
show(positions, options). one-shot. Cell highlight + promote + play win. Returns when the animation fully ends.cycle(lines, options). iterate multiple win lines with a configurable per-line duration and gap, optionally repeating.
Win detection is NOT part of this. pixi-reels never computes wins. your server / game code decides which cells are winners and passes them here. See ADR 007.
Implements#
Constructors#
Constructor#
new SymbolSpotlight(
reels: Reel[],
viewport: ReelViewport,
events: EventEmitter<ReelSetEvents>
): SymbolSpotlight;
Defined in: spotlight/SymbolSpotlight.ts:69
Parameters#
| Parameter | Type |
|---|---|
reels | Reel[] |
viewport | ReelViewport |
events | EventEmitter<ReelSetEvents> |
Returns#
SymbolSpotlight
Accessors#
isActive#
Get Signature#
get isActive(): boolean;
Defined in: spotlight/SymbolSpotlight.ts:75
Returns
boolean
isDestroyed#
Get Signature#
get isDestroyed(): boolean;
Defined in: spotlight/SymbolSpotlight.ts:79
Returns
boolean
Implementation of#
Methods#
cycle()#
cycle(winLines: WinLine[], options?: CycleOptions): Promise<void>;
Defined in: spotlight/SymbolSpotlight.ts:195
Cycle through win lines, showing each for a duration. Returns when all cycles complete or when hide() is called.
Parameters#
| Parameter | Type |
|---|---|
winLines | WinLine[] |
options | CycleOptions |
Returns#
Promise<void>
destroy()#
destroy(): void;
Defined in: spotlight/SymbolSpotlight.ts:229
Returns#
void
Implementation of#
hide()#
hide(): void;
Defined in: spotlight/SymbolSpotlight.ts:150
Hide the spotlight and return symbols to their original positions.
Returns#
void
show()#
show(positions: SymbolPosition[], options?: SpotlightOptions): Promise<void>;
Defined in: spotlight/SymbolSpotlight.ts:84
Show spotlight on specific positions.
Parameters#
| Parameter | Type |
|---|---|
positions | SymbolPosition[] |
options | SpotlightOptions |
Returns#
Promise<void>