PR pixi-reels

index

pixi-reels


pixi-reels / index

index

Classes

ClassDescription
AnimatedSpriteSymbolSymbol implementation using PixiJS AnimatedSprite. Swaps frame arrays on activate. Win animation plays the full sequence.
CascadeModeCascade/tumble spinning mode. Symbols fall from above with gravity-like acceleration, used for tumble/avalanche mechanics.
EventEmitterLightweight typed event emitter with zero dependencies.
FrameBuilderBuilds symbol frames using a middleware pipeline.
ImmediateModeImmediate placement mode for super-turbo skip. Symbols snap to position instantly. no actual spinning animation.
ObjectPoolGeneric object pool for reusing expensive-to-create objects.
PhaseFactoryFactory for creating reel phase instances.
RectMaskStrategyv1 default: a per-reel rectangular mask. Each reel is clipped to its own (offsetY, reelHeight) box so pyramid shapes clip cleanly without buffer-row peek above or below short reels.
ReelOne vertical column of a slot board.
ReelPhaseAbstract base for reel spin phases.
ReelSetThe whole slot board as one object.
ReelSetBuilderThe configurator you call before every reel set.
ReelSymbolOne visible cell on a reel. the thing that actually draws.
ReelViewportThe clipping window + layering tricks for a reel set.
SharedRectMaskStrategySingle bounding-box mask covering every reel’s tallest extent. Use this when symbols need to overlap across reel boundaries. typical for slots with big symbols that span multiple columns (a 2×2 bonus, a 3×3 giant) AND a non-zero symbolGap.x. Per-reel rects would clip those symbols at the column gaps; a single shared rect keeps them visible.
SpeedManagerThe tempo of your reels, as named presets.
SpineSymbolSymbol implementation using Spine 2D skeletal animation.
SpriteSymbolSymbol implementation using a simple PixiJS Sprite. Swaps texture on activate. Win animation is a scale pulse via GSAP.
StandardModeStandard top-to-bottom reel spinning. Symbols scroll downward at constant speed, wrapping around.
SymbolRegistryRegistry that maps symbolIds to their constructors and options.
SymbolSpotlightThe “we just won” visual primitive.
TickerRefSafe wrapper around PixiJS Ticker subscriptions.
WinPresenterHighlights winning cells on a reel set. One job: animate the symbols.

Interfaces

InterfaceDescription
AdjustPhaseConfig-
AnimatedSpriteSymbolOptions-
AnticipationPhaseConfig-
CascadeDropInPhaseConfig-
CascadeFallPhaseConfig-
CascadePlacePhaseConfig-
CellA cell coordinate on the reel set. reel is column, row is visible row.
CellBoundsAxis-aligned bounding box of a single grid cell in ReelSet-local coordinates. Returned by reelSet.getCellBounds(col, row).
CellCoordA grid coordinate.
CellPin-
CellPinOptionsOptions accepted by reelSet.pin().
ColumnTargetPer-reel target shape for ReelSet.setResult and ReelSetBuilder.initialFrame. One object per reel.
CycleOptions-
DebugReelSnapshot-
DebugSnapshotDebug snapshot. plain JSON representation of the entire reel state.
DestroySymbolsOptionsOptions for ReelSet.destroySymbols. Every field is optional; the defaults produce the canonical “winners poof” look (no stagger, no viewport dim, zIndex bumped to 1000 so destroy effects render above neighbouring cells).
DisposableContract for objects that allocate resources and need cleanup. Every class that subscribes to tickers, creates display objects, or holds references must implement this to prevent memory leaks.
DropOffset-
FrameAPIThe runtime-mutable frame-builder pipeline exposed on reelSet.frame. Matches FrameBuilder.use/remove. the internal machinery that already exists; this is the ergonomic surface.
FrameContextContext passed through the middleware pipeline.
FrameMiddlewareMiddleware that participates in frame building.
MaskConfigMask configuration for the reel viewport.
MaskStrategyStrategy for building the viewport’s clip mask. Public. pass a custom implementation to ReelSetBuilder.maskStrategy(...) to clip the reels with any shape PixiJS Graphics can express (rounded frames, hex grids, etc.). v1 ships two strategies:
MovePinOptionsOptions for reelSet.movePin(). flight animation tuning + lifecycle hooks.
MultiWaysConfigMultiWays configuration knobs. Set via builder.multiways({ ... }). mutually exclusive with big-symbol registration.
NoOffsetConfigNo offset configuration.
NudgeOptionsOptions for Reel.nudge() / ReelSet.nudge(). a post-stop reposition that shifts the reel by distance symbol positions and reveals new caller-supplied symbols.
PositionSimple 2D position.
RecordedFrameOne captured frame from startRecording(). a DebugSnapshot plus the tag the recording was started with and the spin event that triggered the capture.
ReelConfig-
ReelEventsEvents emitted by an individual Reel.
ReelExtraSymbolsExtra symbols above/below config per reel.
ReelGridConfigConfiguration for the reel grid layout.
ReelMaskRectBounding rectangle for one reel. what MaskStrategy builds the clip geometry from. Local to ReelViewport (origin = viewport top-left).
ReelSetEventsEvents emitted by a ReelSet.
RefillOptionsOptions for ReelSet.refill. The two required fields encode what just happened (winners) and what the next visible state should be (grid). Everything else is timing / cancellation / animation flavor with sensible defaults.
RefillResultSummary returned by ReelSet.refill. Symmetric with RunCascadeResult. same vocabulary, narrower scope (one stage vs. the full chain).
RunCascadeOptionsOptions for ReelSet.runCascade. The two required callbacks (detectWinners, nextGrid) encode game rules; everything else is timing / cancellation / forwarded-to-destroy plumbing with sensible defaults.
SpeedProfileTiming and animation profile for a speed mode.
SpineSymbolOptions-
SpinningModeStrategy interface for different reel spinning behaviors.
SpinOptionsOptions accepted by reelSet.spin(options?). All fields are optional. passing nothing reproduces the legacy “every reel spins” behaviour.
SpinPhaseConfig-
SpinResultResult returned when a spin completes.
SpotlightOptions-
SpriteSymbolOptions-
StartPhaseConfig-
StartRecordingOptionsOptions for startRecording.
StopPhaseConfig-
SymbolDataPer-symbol configuration data.
SymbolPositionA cell on the visible grid. reelIndex is the column; rowIndex is the row from the top.
TrapezoidConfigTrapezoid perspective configuration.
TumbleConfig-
TumbleDropInConfig-
TumbleFallConfigConfiguration for tumble cascade phases. Passed to ReelSetBuilder.tumble(config) and baked into the three phase classes at build time. Pure animation values. every callback you want is an event (reelSet.events.on('cascade:...', ...)), never a config field.
WinOne “win” as the presenter sees it: an ordered set of cells to highlight.
WinLine-
WinPresenterOptions-

Type Aliases

Type AliasDescription
Matrix2D matrix type (reel × row).
OffsetConfig-
OffsetXModeOffset modes for X-axis symbol positioning.
PinExpireReasonReason a pin expired. Fired with pin:expired. - 'turns' — its turn counter reached zero. - 'explicit' — removed via unpin(). - 'eval' — an eval callback returned false. - 'collision' — a reshape clamped it onto a cell another pin already holds, so it was dropped deterministically.
PinMigrationHow a pin behaves when a MultiWays reshape changes the row count of its reel. Non-MultiWays slots never reshape, so this value is irrelevant there.
ReelAnchorHow to vertically align reels of differing pixel heights.
RunCascadeResultSummary returned by ReelSet.runCascade. Re-exported from the canonical definition in events/ReelEvents.ts so the events module stays the single source of truth for shared shapes.
WinSymbolAnimWhat to play on each cell being highlighted.

Variables

VariableDescription
DEFAULTSDefault values applied when not explicitly set by the builder.
SpeedPresetsBuilt-in speed profiles covering common slot game needs.

Functions

FunctionDescription
clearFramesEmpty the global recording log.
computeDropOffsetsCompute per-row drop offsets for one reel given its winner set.
debugGridPretty-print the grid as an ASCII table.
debugSnapshotTake a plain-JSON snapshot of the entire reel set state.
driveGsapWithTickerDrive GSAP from a PixiJS ticker instead of its own requestAnimationFrame loop, and return a disposer that restores GSAP’s default loop.
enableDebugEnable debug mode: attaches debug utilities to window.__PIXI_REELS_DEBUG.
getFramesAll recorded frames in capture order. When tag is provided, only frames tagged with it are returned. Frames are not cleared between recording sessions. call clearFrames to reset.
pinKeyMap key used internally and exposed by reelSet.pins.
sortByValueDescReturn a new array sorted by value descending (non-mutating). Missing values sort as 0.
startRecordingStart recording the reel-set’s frame state at every key spin event (spin:start, spin:reelLanded, spin:allLanded, spin:complete). Each event captures a DebugSnapshot and pushes it onto a process- wide rolling log readable via getFrames.
stopRecordingDetach the recorder previously installed by startRecording. No-op if none.
whenSpineReadyResolves once the optional @esotericsoftware/spine-pixi-v8 import has settled (whether or not it was installed). Await this before constructing SpineSymbols if you build the reel set immediately on app start, so a cold load can’t throw the misleading “not installed” error.