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.
BoardGridA grid of cells that each spin independently — the generic “board of reels” primitive. Every cell is its own 1×1 ReelSet, so it inherits the engine’s phases, speed modes and pooling rather than a parallel lighter reel.
CascadeModeCascade/tumble spinning mode. Symbols fall from above with gravity-like acceleration, used for tumble/avalanche mechanics.
EmptySymbolA ReelSymbol that renders nothing and never animates.
EventEmitterLightweight typed event emitter with zero dependencies.
FrameBuilderBuilds symbol frames using a middleware pipeline.
HoldAndWinBoardA Hold & Win board: a grid of independently spinning cells plus the round choreography every H&W game repeats — spin the free cells, lock the hits, reset-or-decrement the respin counter, detect the full board.
HoldAndWinBuilderFluent builder for HoldAndWinBoard.
HoldAndWinStateThe pure Hold & Win state machine — the single source of truth for board state, with zero PixiJS. It owns the locked-coin ledger, the respin counter, the round number and the feature HwPhase; every derived value (freeCells, isFull) is computed from the one ledger, never stored in parallel, so nothing can drift out of sync.
HorizontalReelA single horizontal reel — the banner reel that sits above the reels announcing which symbols pay this round.
HorizontalReelBuilderFluent builder for HorizontalReel — the sideways “these symbols pay this round” banner reel above the reels.
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.
SpinTextureCachePer-symbolId cache of “spin textures”. flat snapshots a reel shows instead of the live symbol (Spine skeleton, animated sprite, …) while it spins.
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.
StaticSpinSymbolWraps any ReelSymbol and swaps it for a cached snapshot texture while the reel spins. “spin static, not Spine.”
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-
AnticipationOptionsFull anticipation configuration. The object form of setAnticipation’s second argument.
AnticipationPhaseConfig-
AnticipationSlowdownProgressive slow-down across the tease sequence. Values interpolate linearly across tease-order (first anticipation reel → last), so each successive reel decelerates deeper and/or holds longer than the one before it. This is what turns a flat “everyone drops to 30%” tease into an escalating “each reel crawls slower than the last” build-up.
BoardCellA cell coordinate in the grid.
BoardGridOptions-
BoardSpinTargetA landing target: spin cell and stop it showing id.
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.
HorizontalCascadeTimingDrop/fall timing for HorizontalReel.cascade.
HorizontalReelConfigInternal config produced by HorizontalReelBuilder.build.
HwCellGrid coordinate of a board cell.
HwCellSizeOptions-
HwCoinA coin somewhere on the board. id selects the registered symbol art; data is an opaque game-layer payload the board never interprets.
HwRespinResultResolution of one HoldAndWinBoard.respin wave.
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:
MotionBlurOptionsTuning for the baked motion-blur variant of a snapshot.
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.
PrewarmSpinTexturesOptions-
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.
ScatterAnticipationOptions-
SnapshotRendererThe slice of a PixiJS renderer the cache needs. Renderer (WebGL or WebGPU) satisfies it structurally; tests can pass a stub.
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.
SpinTextureCacheOptions-
SpotlightOptions-
SpriteSymbolOptions-
StartPhaseConfig-
StartRecordingOptionsOptions for startRecording.
StaticSpinSymbolOptions-
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
AnticipationStaggerHow the START of each anticipation reel’s slow-down is spaced (offsets are by tease-order, i.e. position within the anticipation set, not raw reel index): - 0 (default) — every anticipation reel begins slowing together. - number — reel at tease-order k starts k * value ms after the first. - number[] — explicit per-tease-order offset in ms. - 'sequential' — each reel waits until the previous anticipation reel has fully landed before it starts.
BoardProfileA speed profile, or a per-cell function of one (e.g. a stagger wave).
HoldAndWinBoardEvents-
HorizontalDirectionTravel direction of the spin. rtl scrolls leftward, ltr rightward.
HorizontalReelEventsTyped events emitted by HorizontalReel — mirrors the ReelSet names + shapes.
HwEffectOne state-change the reducer (HoldAndWinState) decided, ready for the driver to emit. A tagged pair of { type, payload } for every board event the reducer owns — the driver replays them onto its emitter and keys visual side effects (e.g. playWin() on coin:locked) off the type. respin:start and feature:skip are driver-owned (they describe in-flight reels, not ledger state) and are not produced here.
HwPhase-
HwRespinReasonWhy the respin counter changed — disambiguates a respins:changed event.
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
anticipationForScattersDecide which reels should show anticipation, straight from a result grid.
cellKeycol,row string key for the board’s cell-indexed maps.
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.
prewarmSpinTexturesBake spin textures for every symbolId up front (at load or between rounds) so the first spin never pays a capture hitch. Ids that already have a user-provided or captured texture are skipped by the cache.
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.