index
pixi-reels / index
index
Classes
| Class | Description |
|---|---|
| AnimatedSpriteSymbol | Symbol implementation using PixiJS AnimatedSprite. Swaps frame arrays on activate. Win animation plays the full sequence. |
| BoardGrid | A 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. |
| CascadeMode | Cascade/tumble spinning mode. Symbols fall from above with gravity-like acceleration, used for tumble/avalanche mechanics. |
| EmptySymbol | A ReelSymbol that renders nothing and never animates. |
| EventEmitter | Lightweight typed event emitter with zero dependencies. |
| FrameBuilder | Builds symbol frames using a middleware pipeline. |
| HoldAndWinBoard | A 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. |
| HoldAndWinBuilder | Fluent builder for HoldAndWinBoard. |
| HoldAndWinState | The 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. |
| HorizontalReel | A single horizontal reel — the banner reel that sits above the reels announcing which symbols pay this round. |
| HorizontalReelBuilder | Fluent builder for HorizontalReel — the sideways “these symbols pay this round” banner reel above the reels. |
| ImmediateMode | Immediate placement mode for super-turbo skip. Symbols snap to position instantly. no actual spinning animation. |
| ObjectPool | Generic object pool for reusing expensive-to-create objects. |
| PhaseFactory | Factory for creating reel phase instances. |
| RectMaskStrategy | v1 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. |
| Reel | One vertical column of a slot board. |
| ReelPhase | Abstract base for reel spin phases. |
| ReelSet | The whole slot board as one object. |
| ReelSetBuilder | The configurator you call before every reel set. |
| ReelSymbol | One visible cell on a reel. the thing that actually draws. |
| ReelViewport | The clipping window + layering tricks for a reel set. |
| SharedRectMaskStrategy | Single 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. |
| SpeedManager | The tempo of your reels, as named presets. |
| SpineSymbol | Symbol implementation using Spine 2D skeletal animation. |
| SpinTextureCache | Per-symbolId cache of “spin textures”. flat snapshots a reel shows instead of the live symbol (Spine skeleton, animated sprite, …) while it spins. |
| SpriteSymbol | Symbol implementation using a simple PixiJS Sprite. Swaps texture on activate. Win animation is a scale pulse via GSAP. |
| StandardMode | Standard top-to-bottom reel spinning. Symbols scroll downward at constant speed, wrapping around. |
| StaticSpinSymbol | Wraps any ReelSymbol and swaps it for a cached snapshot texture while the reel spins. “spin static, not Spine.” |
| SymbolRegistry | Registry that maps symbolIds to their constructors and options. |
| SymbolSpotlight | The “we just won” visual primitive. |
| TickerRef | Safe wrapper around PixiJS Ticker subscriptions. |
| WinPresenter | Highlights winning cells on a reel set. One job: animate the symbols. |
Interfaces
| Interface | Description |
|---|---|
| AdjustPhaseConfig | - |
| AnimatedSpriteSymbolOptions | - |
| AnticipationOptions | Full anticipation configuration. The object form of setAnticipation’s second argument. |
| AnticipationPhaseConfig | - |
| AnticipationSlowdown | Progressive 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. |
| BoardCell | A cell coordinate in the grid. |
| BoardGridOptions | - |
| BoardSpinTarget | A landing target: spin cell and stop it showing id. |
| CascadeDropInPhaseConfig | - |
| CascadeFallPhaseConfig | - |
| CascadePlacePhaseConfig | - |
| Cell | A cell coordinate on the reel set. reel is column, row is visible row. |
| CellBounds | Axis-aligned bounding box of a single grid cell in ReelSet-local coordinates. Returned by reelSet.getCellBounds(col, row). |
| CellCoord | A grid coordinate. |
| CellPin | - |
| CellPinOptions | Options accepted by reelSet.pin(). |
| ColumnTarget | Per-reel target shape for ReelSet.setResult and ReelSetBuilder.initialFrame. One object per reel. |
| CycleOptions | - |
| DebugReelSnapshot | - |
| DebugSnapshot | Debug snapshot. plain JSON representation of the entire reel state. |
| DestroySymbolsOptions | Options 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). |
| Disposable | Contract 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 | - |
| FrameAPI | The runtime-mutable frame-builder pipeline exposed on reelSet.frame. Matches FrameBuilder.use/remove. the internal machinery that already exists; this is the ergonomic surface. |
| FrameContext | Context passed through the middleware pipeline. |
| FrameMiddleware | Middleware that participates in frame building. |
| HorizontalCascadeTiming | Drop/fall timing for HorizontalReel.cascade. |
| HorizontalReelConfig | Internal config produced by HorizontalReelBuilder.build. |
| HwCell | Grid coordinate of a board cell. |
| HwCellSizeOptions | - |
| HwCoin | A coin somewhere on the board. id selects the registered symbol art; data is an opaque game-layer payload the board never interprets. |
| HwRespinResult | Resolution of one HoldAndWinBoard.respin wave. |
| MaskConfig | Mask configuration for the reel viewport. |
| MaskStrategy | Strategy 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: |
| MotionBlurOptions | Tuning for the baked motion-blur variant of a snapshot. |
| MovePinOptions | Options for reelSet.movePin(). flight animation tuning + lifecycle hooks. |
| MultiWaysConfig | MultiWays configuration knobs. Set via builder.multiways({ ... }). mutually exclusive with big-symbol registration. |
| NoOffsetConfig | No offset configuration. |
| NudgeOptions | Options for Reel.nudge() / ReelSet.nudge(). a post-stop reposition that shifts the reel by distance symbol positions and reveals new caller-supplied symbols. |
| Position | Simple 2D position. |
| PrewarmSpinTexturesOptions | - |
| RecordedFrame | One captured frame from startRecording(). a DebugSnapshot plus the tag the recording was started with and the spin event that triggered the capture. |
| ReelConfig | - |
| ReelEvents | Events emitted by an individual Reel. |
| ReelExtraSymbols | Extra symbols above/below config per reel. |
| ReelGridConfig | Configuration for the reel grid layout. |
| ReelMaskRect | Bounding rectangle for one reel. what MaskStrategy builds the clip geometry from. Local to ReelViewport (origin = viewport top-left). |
| ReelSetEvents | Events emitted by a ReelSet. |
| RefillOptions | Options 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. |
| RefillResult | Summary returned by ReelSet.refill. Symmetric with RunCascadeResult. same vocabulary, narrower scope (one stage vs. the full chain). |
| RunCascadeOptions | Options 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 | - |
| SnapshotRenderer | The slice of a PixiJS renderer the cache needs. Renderer (WebGL or WebGPU) satisfies it structurally; tests can pass a stub. |
| SpeedProfile | Timing and animation profile for a speed mode. |
| SpineSymbolOptions | - |
| SpinningMode | Strategy interface for different reel spinning behaviors. |
| SpinOptions | Options accepted by reelSet.spin(options?). All fields are optional. passing nothing reproduces the legacy “every reel spins” behaviour. |
| SpinPhaseConfig | - |
| SpinResult | Result returned when a spin completes. |
| SpinTextureCacheOptions | - |
| SpotlightOptions | - |
| SpriteSymbolOptions | - |
| StartPhaseConfig | - |
| StartRecordingOptions | Options for startRecording. |
| StaticSpinSymbolOptions | - |
| StopPhaseConfig | - |
| SymbolData | Per-symbol configuration data. |
| SymbolPosition | A cell on the visible grid. reelIndex is the column; rowIndex is the row from the top. |
| TrapezoidConfig | Trapezoid perspective configuration. |
| TumbleConfig | - |
| TumbleDropInConfig | - |
| TumbleFallConfig | Configuration 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. |
| Win | One “win” as the presenter sees it: an ordered set of cells to highlight. |
| WinLine | - |
| WinPresenterOptions | - |
Type Aliases
| Type Alias | Description |
|---|---|
| AnticipationStagger | How 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. |
| BoardProfile | A speed profile, or a per-cell function of one (e.g. a stagger wave). |
| HoldAndWinBoardEvents | - |
| HorizontalDirection | Travel direction of the spin. rtl scrolls leftward, ltr rightward. |
| HorizontalReelEvents | Typed events emitted by HorizontalReel — mirrors the ReelSet names + shapes. |
| HwEffect | One 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 | - |
| HwRespinReason | Why the respin counter changed — disambiguates a respins:changed event. |
| Matrix | 2D matrix type (reel × row). |
| OffsetConfig | - |
| OffsetXMode | Offset modes for X-axis symbol positioning. |
| PinExpireReason | Reason 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. |
| PinMigration | How 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. |
| ReelAnchor | How to vertically align reels of differing pixel heights. |
| RunCascadeResult | Summary 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. |
| WinSymbolAnim | What to play on each cell being highlighted. |
Variables
| Variable | Description |
|---|---|
| DEFAULTS | Default values applied when not explicitly set by the builder. |
| SpeedPresets | Built-in speed profiles covering common slot game needs. |
Functions
| Function | Description |
|---|---|
| anticipationForScatters | Decide which reels should show anticipation, straight from a result grid. |
| cellKey | col,row string key for the board’s cell-indexed maps. |
| clearFrames | Empty the global recording log. |
| computeDropOffsets | Compute per-row drop offsets for one reel given its winner set. |
| debugGrid | Pretty-print the grid as an ASCII table. |
| debugSnapshot | Take a plain-JSON snapshot of the entire reel set state. |
| driveGsapWithTicker | Drive GSAP from a PixiJS ticker instead of its own requestAnimationFrame loop, and return a disposer that restores GSAP’s default loop. |
| enableDebug | Enable debug mode: attaches debug utilities to window.__PIXI_REELS_DEBUG. |
| getFrames | All 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. |
| pinKey | Map key used internally and exposed by reelSet.pins. |
| prewarmSpinTextures | Bake 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. |
| sortByValueDesc | Return a new array sorted by value descending (non-mutating). Missing values sort as 0. |
| startRecording | Start 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. |
| stopRecording | Detach the recorder previously installed by startRecording. No-op if none. |
| whenSpineReady | Resolves 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. |