pixi-reels
All mechanics

Mechanics

Big symbols and MultiWays

Symbols that span several cells, and boards whose reels show different numbers of rows.

Demos

The first half of this page covers big symbols, one symbol that covers a block of cells. It starts with blocks that land in full view and moves on to blocks that land partly hidden in a buffer or scroll past during the spin. The second half covers boards whose reels show different numbers of cells: a fixed pyramid and MultiWays.

Big symbols#

Block shapes#

Four shapes, one demo each: a 2x2 square, a 1x3 tall block, a 3x3 giant and a 2x4 wide block. The server places the anchor cell and the engine fills the rest of the block.

Loading recipe…

Loading recipe…

Loading recipe…

Loading recipe…

Outline a block#

getBlockBounds returns one rectangle around the whole block, whichever of its cells you pass. For a 1x1 cell it returns the same rect as getCellBounds.

Loading recipe…

Spine art#

The same 2x2 anchor mechanic with a Spine skeleton in every cell. The big wild reuses the wild rig, scaled to the size of the block.

Loading recipe…

Horizontal reels#

A 2x3 block on a set built with .orientation('horizontal'), outlined on landing with getBlockBounds. size: { reels, cells } is in index space and does not rotate. reels always counts across reels, and cells always counts along the strip.

The screen shape flips with the orientation. { reels: 2, cells: 3 } is 2 wide and 3 tall on a vertical set, and 2 tall and 3 wide here. getBlockBounds works in screen space, so its rect flips too.

Loading recipe…

Blocks in the buffer#

A block’s anchor can sit outside the visible window, so only part of the block shows when the reel lands. The game then brings the rest into view.

Land partly in the buffer#

A 1x3 block lands with its anchor in bufferStart, so only its bottom cell shows, at cell 0. A downward nudge drags the rest into view.

Loading recipe…

Nudge in, then hold for a respin#

The partly hidden wild is nudged into full view. Then the other reels respin with holdReels, so the block stays where it is.

Loading recipe…

Reverse reels#

The same partial landing on a reel built with .direction('reverse'), which rolls up. The block is anchored at the last visible cell with its body in bufferEnd, and a 'forward' nudge, which moves up on this reel, drags it into full view.

Buffers are positional and do not follow the travel direction. bufferStart is above and bufferEnd is below in both directions, so a reel that feeds from the bottom shows its partial block out of bufferEnd.

Loading recipe…

Fall into view in a cascade#

A tall wild lands with its anchor in bufferStart and only its tail showing. The cells below it win, and the wild falls into full view as they clear. The second demo does the same with a 2x2 block across two reels.

The anchor’s fall distance must equal the number of winning cells cleared below it, or the block snaps instead of falling.

Loading recipe…

Loading recipe…

Blocks during the spin#

Tall blocks in the spin#

A 1x3 block with a weight scrolls past on reel 0 while it spins, and a scatter only ever scrolls past on reel 4. Both weights are set in per-reel pools: 0 in the base weights() table, and raised on the one reel that may show the symbol. Only blocks one reel wide can have a weight. Wider blocks still appear only on landing, because the random fill feeds one reel at a time.

A narrower pool cannot lift an exclude set by a wider one, but it can raise a weight of 0. To allow a symbol on one reel only, use weights, not exclude. A weighted block also needs bufferSymbols({ start: size.cells }), and the builder checks for it. The block enters a forward reel bottom first and leaves a reverse reel anchor first, and the buffer slots hold its covered cells while the anchor that draws them is off the strip.

Loading recipe…

Peek, then bring it up#

Two scatters slow reel 4 into an anticipation crawl, and the weighted 1x3 keeps sliding past during it. The result lands the block with its head on the last visible cell and its body in bufferEnd, so the set uses bufferSymbols({ start: 3, end: 2 }): start for the weight and end for the peek. The two demos then bring the block up in different ways.

  • Nudge up: nudge(reel, { distance: 2, direction: 'reverse' }) moves the whole column, and the two cards above scroll out through the top.
  • Expand up: the landed anchor is already one sprite three cells tall, with its body under the mask. Tween its view up two cells so it grows over the cards, then call setColumn(reel, { visible: ['tall', ...] }) to commit the block at the top of the column. The rest of the board stays put. In engine terms this is an expanding wild.

getBlockBounds reports the whole block even while part of it is in a buffer. The mask does the clipping.

Loading recipe…

Loading recipe…

Reel shapes#

Pyramid#

A set whose reels show 3, 5, 5, 5 and 3 cells. The shape is fixed at build time with visibleCellsPerReel.

Loading recipe…

Pyramid with Spine#

The same pyramid with a Spine skeleton in every cell. The rigs stay sharp at each reel’s cell size.

Loading recipe…

MultiWays#

Each reel lands on a different cell count every spin, and the number of ways is the product of the cell counts.

Call setShape(cellsPerReel) before setResult() on every spin.

Loading recipe…

MultiWays cascade#

A MultiWays shape on a normal strip landing, followed by a cascade that removes the ways winners and drops new symbols in from above.

Call setShape before setResult, and start the round with spin({ mode: 'standard' }) so AdjustPhase reshapes the reels between the spin and stop phases.

Loading recipe…

Sticky wild on MultiWays#

A pin keeps its place across reshapes through its remembered originCell, with the default migration: 'origin'. It moves in when the reel shrinks and returns when the reel grows back. With 'frozen', each clamp rewrites the origin, so the pin never moves back.

Loading recipe…

Concept

Per-reel geometry
Reels do not all need the same cell count. Static pyramids, the mask that clips them, and what cannot be combined.

Most slots are uniform: every reel has the same number of cells, and this part does not apply to them. It covers three other shapes:

ShapeChanges whenWhere
Static pyramid (3-5-5-5-3)Never. Fixed at build.below
MultiWaysEvery spinMultiWays
Big symbols (N x M blocks)Never. One symbol covers many cells.Big symbols

What cannot be combined#

Two combinations throw at build().

MultiWays and a pyramid. visibleCellsPerReel() declares a fixed shape and multiways() declares one that the server sets. Both set the cell count, so use one or the other.

MultiWays and big symbols. A 2x2 block cannot fit a reel that has reshaped to 2 cells. Whether to truncate it, skip it or shrink it is a game design decision, so the engine does not pick one.

Big symbols and pyramids do work together. So do MultiWays and cascades (ADR 015).

Static pyramid#

new ReelSetBuilder()
  .reels(5)
  .visibleCellsPerReel([3, 5, 5, 5, 3])
  .reelAnchor('center')                   // 'start' | 'center' | 'end'
  .symbolSize(120, 120)
  .build();

Short reels are offset along the strip so they sit where reelAnchor says. The default mask clips each reel to its own box, so a short reel never shows its buffer cells. getCellBounds(reel, cell) includes the offset.

The per-reel shape demo runs this.

Masks#

The clip mask comes from a MaskStrategy. Two ship with the library:

StrategyClipsCosts you
RectMaskStrategy (default)One rect per reelA symbol spanning two reels is cut at the gap between them
SharedRectMaskStrategyOne rect over everythingOn a pyramid, buffer cells past short reels show (the “pyramid peek”)

The engine picks SharedRectMaskStrategy when big or unmasked symbols are registered and the gap between reels is non-zero, because per-reel rects would visibly cut a block in that case. Override it with .maskStrategy().

import { SharedRectMaskStrategy } from 'pixi-reels';
builder.maskStrategy(new SharedRectMaskStrategy());

For a rounded frame or a hex grid, implement MaskStrategy yourself. It takes one MaskContext and returns a Graphics filled with any shape Pixi can draw. Set version = MASK_STRATEGY_VERSION on it. The masks page has strategies for common shapes.

To see what is clipped:

import { debugOverlay } from 'pixi-reels/debug'; // needs pixi-silk, a dev dependency

debugOverlay(reelSet, { layers: ['mask', 'cells', 'buffers'] });

See also#

Big symbols
A big symbol is one symbol that covers an N x M block of cells. You declare it with SymbolData.size, the server places the anchor cell, and the engine fills the rest of the block. This part covers lookup, validation and how the mask interacts.

A big symbol is one symbol that covers a rectangular block of cells, such as a 2x2 bonus or a 1x3 bar. You declare it at registration with a size in its symbol data. The result format does not change. The server places the symbol id in the anchor cell, and the engine fills the rest of the block with a placeholder.

For pyramids, MultiWays and what cannot be combined, start at Per-reel geometry.

Declaration#

Register it like any other symbol and add a size, with a reel count and a cell count, to its symbol data:

.symbols((registry) => {
  registry.register('bonus', SpriteSymbol, { textures: { bonus: tex } });
})
.symbolData({
  bonus: { weight: 0, zIndex: 5, size: { reels: 2, cells: 2 } },
  //         ^^^^^^^^^ a block wider than one reel must have weight 0.
  //                   Random fill feeds one reel at a time and cannot place
  //                   it, so the builder throws on a non-zero weight.
})

The zIndex: 5 is a convention in the recipes. It puts the anchor above its 1x1 neighbours so it draws on top.

The result format#

The server puts the symbol id in the anchor cell of the block only. Every other cell of the block can hold any string, because the engine overwrites it with the occupied placeholder.

// 5x4 grid, 2x2 bonus anchored at (reel=2, cell=1):
setResult([
  { visible: ['low1', 'low2', 'low1', 'low2'] },
  { visible: ['low1', 'low2', 'low1', 'low2'] },
  { visible: ['low1', 'bonus',  '?',   'low2'] }, // '?' is whatever; engine paints OCCUPIED
  { visible: ['low1', '?',      '?',   'low2'] }, // '?' is whatever; engine paints OCCUPIED
  { visible: ['low1', 'low2', 'low1', 'low2'] },
]);

Before the per-reel frames are built, the spin controller reads the result grid, finds the anchors, checks that each block fits, and paints the placeholder across the rest of each block. At landing, the anchor symbol is sized to span the whole block, gaps included: w cells wide plus w - 1 gaps, and h cells tall plus h - 1 gaps. The other cells of the block get an invisible stub, and the anchor’s view covers them.

The public API never returns the placeholder. Reel.getVisibleSymbols() and ReelSet.getVisibleGrid() both resolve it to the anchor’s id, on the anchor’s reel and on the other reels the block covers, so the two return the same data.

Block lookup#

getSymbolFootprint returns the block itself, its anchor cell and size, for win evaluation and event payloads. getBlockBounds returns the pixel rect that covers the whole block, for overlays.

const fp = reelSet.getSymbolFootprint(reel, cell);
// { anchor: { reel: 2, cell: 1 }, size: { reels: 2, cells: 2 } }

const rect = reelSet.getBlockBounds(reel, cell);
// { x, y, width: 2*cellW + symbolGap.x, height: 2*cellH + symbolGap.y }
gfx.rect(rect.x, rect.y, rect.width, rect.height).stroke({ color: 0xff6b35, width: 4 });

Both return the same data for any cell of the block, anchor or not. For a 1x1 cell, getBlockBounds returns the same rect as getCellBounds.

Validation#

During a spin, setResult() throws at once if a block does not fit:

  • "big symbol 'giant' (3x3) at (reel=4, cell=2) exceeds reel count 6."
  • "big symbol 'tallBar' (1x3) at (reel=0, cell=3) extends past the bottom of the strip on reel 0 (anchor cell + h = 6 > visibleCells + bufferEnd = 4)."

The check along the strip counts the visible cells plus the end buffer, not the visible window alone, so a block may land partly in either buffer.

A setResult() with no spin in flight returns early and validates nothing.

Pinning a cell of a big symbol other than the anchor is not supported, and it does not throw either. The engine repaints that cell as occupied at the next setResult() and the pin is lost without a warning. Pin the anchor instead. Its view spans the block, so the whole block looks pinned. setSymbolAt() on a cell other than the anchor does throw.

The build-time check refuses a block wider than one reel with a non-zero weight, with a message that starts big symbol 'bonus' (size 2x2) must have weight 0. Random fill feeds one reel at a time and cannot place such a block, so its weight would never be used. A block one reel wide may have a weight.

Partial landings#

An anchor does not have to be in a visible cell. Put a tall block’s anchor in the start buffer and only its tail shows, at the top of the window. Anchor it at the last visible cell and its head shows while the rest extends into the end buffer.

Use the explicit ColumnTarget form to target buffer slots:

// 1x3 wild lands with its tail at visible cell 0; anchor + one stub are
// off-screen in bufferStart. Requires bufferSymbols(2) or more.
reelSet.setResult([
  { visible: [...], bufferStart: [undefined, 'tallWild'] },
  // ...
]);

For that reel, getSymbolFootprint(reel, 0) reports the anchor at cell -2. The index is negative because the anchor sits before the window. getBlockBounds(reel, 0) returns the whole block’s rect, off-screen part included, and the mask does the clipping. The partial landing demo runs this.

Masks for wide blocks#

With a gap between reels, the default per-reel mask leaves that gap unmasked. A big symbol’s anchor view extends across several reels, and the per-reel mask clips it at every gap, which shows as transparent strips through the symbol.

The engine picks SharedRectMaskStrategy on its own when all three hold:

  1. At least one registered big symbol is wider than one reel, or any symbol sets unmask: true.
  2. The gap between reels is above 0: symbolGap.x on a vertical set, symbolGap.y on a horizontal one.
  3. No explicit .maskStrategy(...) call was made.

It reports the choice on the notice channel, and .maskStrategy(...) overrides it.

A stack one reel wide (size: { reels: 1, cells: 3 }) never crosses a gap, so it keeps the per-reel mask. That mask also suits a reel that setColumn() or splitSymbol() makes taller or shorter than the rest. With one shared box, the buffer cells past the shorter reels would show. Art that extends past its cell into the gap is clipped there. Pass the shared strategy yourself if you want one box.

import { SharedRectMaskStrategy } from 'pixi-reels';

builder
  .symbolGap(4, 4)                                  // horizontal gap > 0
  .maskStrategy(new SharedRectMaskStrategy())       // explicit (or rely on auto-pick)
  // ...

SharedRectMaskStrategy draws one rect over the whole set. On a pyramid that means the buffer cells past the ends of short reels become visible, the “pyramid peek”. Games usually cover it with frame art.

Draw order#

By default an anchor renders at symbolData.zIndex * 100 + arrayIndex, about 500 with zIndex: 5. The 100x multiplier leaves room for per-cell order inside one layer, so cells further along the strip still draw in front of their neighbours.

When you want a different order, pass a resolver and the engine uses its answer instead. For example, the symbol in the bottom row can always draw in front of the one above it, whatever its type:

.symbolZIndex((ctx) => {
  if (!ctx.atRest || ctx.visibleCell === null) return ctx.defaultZIndex;
  const grade = GRADES[ctx.symbolId];
  return grade === undefined
    ? ctx.defaultZIndex
    : grade * 1000 + ctx.visibleCell * 10 + ctx.reelIndex;
})

The resolver receives the symbol id and data, the reel index and count, the array index, the visible cell (null for a buffer slot), the visible cell count, whether the reel is at rest, and the z-index the engine would have used. The engine calls it again whenever a symbol’s id, cell, reel shape or rest state changes, so its answer is never overwritten. Order across reels only exists for symbols that share a container: an unmask: true symbol at rest sits in the viewport-wide unmasked container with every other lifted symbol, while a masked one is bounded by its reel container’s own z-index (reelStacking). That is why the example grades at rest only and keeps the engine’s order in motion. Keep every value below Z_INDEX_BUDGET.pinOverlay.

Pin overlays render at z-index 10000 (Z_INDEX_BUDGET.pinOverlay; Z_INDEX_BUDGET.symbolLayer is the 100x). So a big symbol that is also pinned at its anchor gets its overlay above the cell. The overlay is sized to a single cell, so while the reel spins it does not cover the rest of the block. The block spans again once the frame commits at landing.

LayerzIndexSource
1x1 symbol, default0 * 100 + arrayIndexsymbolData.zIndex ?? 0
1x1 symbol, elevated1 * 100 + arrayIndexsymbolData.zIndex: 1
Big-symbol anchor (recipe convention)5 * 100 + arrayIndex (~500)symbolData.zIndex: 5
Pin overlay during spin10000internal (engine-managed)
Spotlight (winning symbols)own containerviewport.spotlightContainer

Constraints#

  • A block wider than one reel needs weight 0. Random fill cannot place it and the builder throws on a non-zero weight. The server places it through setResult().
  • A block wider than one reel exists only at landing. During the spin every cell is 1x1, and the block layout is applied at the stop. A block one reel wide with a weight can also scroll past during the spin, as the tall blocks demo shows.
  • Big symbols and MultiWays are rejected at build. See the constraint table.

See also#

MultiWays
Every reel can land on a different cell count, every spin. The cell size comes from a fixed reel extent, and pins migrate by their origin cell.

In a MultiWays slot each reel lands on a different cell count, every spin. The reel’s length is fixed and the cell size is derived from it: the extent divided by that reel’s cell count. A 2-cell reel has big cells and a 7-cell reel has small ones.

Setup#

const reelSet = new ReelSetBuilder()
  .reels(6)
  .multiways({ minCells: 2, maxCells: 7, reelExtent: 480 })
  .pinMigrationDuration(300)         // ms for the pin-overlay tween. 0 = snap
  .pinMigrationEase('power2.inOut')  // any GSAP ease
  .symbolSize(68, 68)                // the spin-time cell size
  .build();

const promise = reelSet.spin();
reelSet.setShape([3, 5, 7, 4, 6, 2]);  // before setResult
reelSet.setResult(serverGrid);          // serverGrid[i].visible.length === shape[i]
await promise;

Call order#

  1. spin(): the reels scroll at the previous shape’s cell size.
  2. setShape(cellsPerReel): records the target, emits shape:changed, then migrates pins (pin:migrated). Call it before setResult. Called after, it throws, because the frames are already cached by then.
  3. setResult(grid): each column’s visible length must equal that reel’s entry in the shape.
  4. The reshape runs between the spin and stop phases. Per reel it fires adjust:start, commits the geometry, refreshes pin overlays, and fires adjust:complete.
  5. The stop phase lands at the new shape.

Pin migration#

A pin remembers the cell it started in, its originCell. Every reshape moves it according to its migration policy and fires pin:migrated with the old cell, the new cell, the reel index, and whether it was clamped.

The origin policy#

'origin' is the default. A pin that a shrink moved down to a lower cell moves back when the reel grows again, which is what a sticky wild needs.

SpinCells on reel 2originCellLands atClamped?
1544no
2342yes
3744restored
4443yes

The frozen policy#

With 'frozen', each clamp rewrites the origin cell, so the pin never moves back. Use it for walking wilds, or anywhere the pin’s current cell matters and its old cell does not.

SpinCells on reel 2originCell beforeLands atoriginCell after
15444
2342 (clamped)2
37222
44222
reelSet.pin(reel, cell, id, { migration: 'frozen' });

What animates#

pinMigrationDuration and pinMigrationEase apply to pin overlays only. The cells underneath snap, because the reel is still spinning at full speed during the reshape, and a tween on a cell would conflict with the motion layer over the same coordinate.

With no pins on a reel, no tween is built. adjust:start and adjust:complete still fire around the reshape, because they come from the reshape step and not from the tween. If the shape did not change, neither fires.

skipSpin() skips the tween.

MultiWays events#

  • shape:changed: setShape() accepted a target
  • adjust:start / adjust:complete: per reel, around the reshape
  • pin:migrated: a pin moved because the shape changed

Limits#

  • No big symbols. A 2x2 cannot fit a reel that reshaped to 2 cells, so build() throws.
  • No pyramid. visibleCellsPerReel() and multiways() both claim the cell count, so build() throws.
  • reelExtent is fixed. To change it, rebuild.

Cascades do work with MultiWays (ADR 015). See the MultiWays cascade demo.

See also#

Buffer indexing
How ColumnTarget indices map to cells in initialFrame and setResult: visible cells, buffer start, buffer end.

A reel has more cells than the player sees. ColumnTarget addresses all of them.

Why buffers exist#

Every reel keeps a few hidden cells past each end of the visible window. They hold the next symbol about to wrap onto the strip, and they scroll through view during a spin, so the motion looks continuous. They also let a win animation move past the edge without showing an empty strip.

Set the count with .bufferSymbols(n). Most slots use 1 or 2. More than 2 is unusual.

ColumnTarget#

ColumnTarget
  • visible: string[]length = visibleCells
  • bufferStart?: (string | undefined)[][0] closest to visible
  • bufferEnd?: (string | undefined)[][0] closest to visible

One object per reel. Hand an array of them to setResult on the reel set or to initialFrame on the builder. Both take the same shape.

Start is the smaller screen coordinate: above on a vertical set, left on a horizontal one. It does not follow the travel direction. See Orientation & direction.

Which index is which cell#

One reel, with bufferSymbols(2) and visibleCells(3), has seven cells:

ColumnTarget fieldCellPlayer sees it at rest?bufferStart[1]buffer start 1no, furthest past the edgebufferStart[0]buffer start 0no, just past the edgevisible[0]visible cell 0yes, firstvisible[1]visible cell 1yes, middlevisible[2]visible cell 2yes, lastbufferEnd[0]buffer end 0no, just past the edgebufferEnd[1]buffer end 1no, furthest past the edge

The buffers hide behind the mask at rest and pass through view during a spin.

Example#

import type { ColumnTarget } from 'pixi-reels';

const grid: ColumnTarget[] = [
  { visible: ['A', 'B', 'C'], bufferStart: ['COIN', 'WILD'] },
  { visible: ['A', 'B', 'C'], bufferEnd: ['SCATTER'] },
];

reelSet.setResult(grid);
// Same shape at build time:
builder.initialFrame(grid);

Index 0 of a buffer array is the slot nearest the visible window and index 1 is one further out. An entry past the configured buffer count throws instead of being dropped, so the mistake shows at the call.

Unset cells#

Any cell you leave unset gets a random symbol, buffer cells included. By default buffer cells draw from the same weight table as the strip. A pool with slots: 'buffer' restricts the cells outside the window only:

// A coin may blur past mid-spin, but must never park half-visible
// above or below the grid.
reelSet.randomSymbols.set({ exclude: ['COIN'] }, { slots: 'buffer' });

// Same thing at build time, so even the initial strip obeys it.
builder.randomSymbols({ exclude: ['COIN'] }, { slots: 'buffer' });

Each end can have its own pool, named after its buffer:

// Nothing peeks in from above; the cell below the grid is left alone.
reelSet.randomSymbols.set({ exclude: ['COIN'] }, { slots: 'bufferStart' });

Add { reel: n } to any of them for one reel only, so { reel: 2, slots: 'bufferEnd' } is one end of one reel. A weight of 0 bans a symbol as surely as exclude does. Each layer applies on top of the wider ones. A symbol the strip may not show cannot appear in a buffer cell either, and a symbol a 'buffer' pool bans is banned at both ends whatever the pools for each end say. An explicit buffer entry in a target always wins over a pool.

Big symbols in buffers#

A big-symbol anchor can sit in the start buffer, or in a visible cell whose block extends into the end buffer. Pass the anchor and the engine fills the rest of the block.

The block must fit on the strip, not inside the visible window: the anchor cell plus the block’s height may not exceed the visible cells plus the end buffer. That is what allows a block that is mostly hidden with one cell showing.

See also#

API

Every exported name the concept, the demos and their sources use, with the one-line summary from the generated reference.

  • Tween-only phase between SPIN and STOP for MultiWays slots.

  • One visible cell on a reel. the thing that actually draws.

  • v1 default: a per-reel rectangular mask. Each reel is clipped to its own (mainOffset, extent) box so pyramid shapes clip cleanly without buffer-cell peek…

  • Reelclass

    One vertical column of a slot board.

  • ReelSetclass

    The whole slot board as one object.

  • The configurator you call before every reel set.

  • Single bounding-box mask covering every reel. Use this when symbols need to overlap across reel boundaries. typical for slots with big symbols that span…

  • ReelSymbol implementation using Spine 2D skeletons.

  • Per-symbolId cache of "spin textures". flat snapshots a reel shows instead of the live symbol (Spine skeleton, animated sprite, ...) while it spins.

  • Symbol implementation using a simple PixiJS Sprite. Swaps texture on activate. Win animation is a scale pulse via GSAP.

  • Wraps any ReelSymbol and swaps it for a cached snapshot texture while the reel spins. "spin static, not Spine."

  • debugOverlayfunction

    A layered visual debug overlay for a ReelSet, drawn with pixi-silk: mask, cell, buffer, axis, symbol-bounds, big-symbol-block and pin geometry, a per-reel…

  • stepfunction

    Build a PhaseStep.

  • Cellinterface

    A cell coordinate on the reel set. reel is column, cell is visible cell.

  • ColumnTargetinterface

    Per-reel target shape for ReelSet.setResult and ReelSetBuilder.initialFrame. One object per reel.

  • MaskContextinterface

    Everything a mask strategy is given. Passed as one object so the axis cannot be forgotten, and so later additions do not break the signature.

  • MaskStrategyinterface

    Strategy for building the viewport's clip mask. Public. pass a custom implementation to ReelSetBuilder.maskStrategy(...) to clip the reels with any shape…

  • SpinOptionsinterface

    Options accepted by reelSet.spin(options?). All fields are optional. passing nothing reproduces the legacy "every reel spins" behaviour.

  • Standard high-card deck for prototyping. Each card has its own color so a full grid is visually unambiguous at a glance.

  • Version marker every strategy must carry. A v1 strategy has positional (rects, totalWidth, totalHeight) parameters and no axis; handed a MaskContext it would…

  • Built-in speed profiles covering common slot game needs.

  • A pale-yellow WILD card for sticky/expanding-wild prototypes.

  • The z-index values the engine reserves, so a SymbolZIndexResolver can be bounds-checked against the library instead of a copied literal.

Questions

From the FAQ, the questions tagged with this mechanic. Open one here, or follow it to its own page.

How do I make a symbol from a Spine skeleton?open

Use SpineSymbol (or SpineReelSymbol) from pixi-reels/spine with a skeletonDataMap / spineMap.

Question page
How do I land a symbol just above the visible window (in the buffer)?open

Put the symbol in that reel's bufferStart, e.g. { visible: [...], bufferStart: ['COIN'] }.

Question page
How do I land a tall symbol partially off-screen so only its edge shows?open

Anchor a tall block in bufferStart so only its tail shows at row 0; the viewport mask clips the off-screen part.

Question page
How do I land a different row count on each reel in one result?open

Build with .multiways({ minCells, maxCells, reelExtent }) and pass a per-reel ColumnTarget[] whose visible arrays differ in length.

Question page
How do I send a structured result that survives JSON or postMessage?open

Use the explicit ColumnTarget object form ({ visible, bufferStart, bufferEnd }). It survives JSON or postMessage, unlike the negative-index array form.

Question page
How do I add rows to a reel at runtime (the board grows)?open

MultiWays changes a reel's visible row count per spin (via setShape + the AdjustPhase); a permanent static row change otherwise needs a rebuild.

Question page
How do I keep a tall block intact while everything else scrolls?open

Big-symbol blocks stay intact through spins and cascades automatically, you place the anchor and the engine paints OCCUPIED across the rest of the block.

Question page
How do I evaluate pays both ways (left-to-right and right-to-left)?open

Evaluate both directions in your win logic and feed all winning cells to the presenter. The engine is direction-agnostic.

Question page
How do I keep a pin in place when the board reshapes (MultiWays)?open

Pins clamp and restore automatically across MultiWays reshapes; pin:migrated fires when they move.

Question page
How do I make a pin migrate back to its origin row when there is room?open

reelSet.pin(reel, cell, id, { migration: 'origin', originCell }). 'origin' is already the default, so you only need originCell when the origin differs from the cell you are pinning. The pin clamps when the shape shrinks and climbs back toward originCell when it grows again. Use migration: 'frozen' for lock-and-never-restore.

Question page
How do I place a 2x2 symbol on the board?open

Give the id size: { reels: 2, cells: 2 } via .symbolData(...) and weight: 0 via .weights(...), place its anchor cell via setResult, and the engine paints OCCUPIED across the block.

Question page
How do I make a 3x3 colossal symbol overlay the grid?open

Same mechanic with size: { reels: 3, cells: 3 } (via .symbolData(...)); use SharedRectMaskStrategy so the block is not clipped per reel.

Question page
How do I make a 1x3 tall bar symbol?open

Give the id size: { reels: 1, cells: 3 } via .symbolData(...).

Question page
How do I stop a big symbol from being placed by random fill?open

Give it weight: 0 so it only ever comes from setResult / the server, never random fill.

Question page
How do I land a tall block with only its bottom cell visible?open

Anchor the tall block in bufferStart so only its bottom cell shows at row 0.

Question page
How do I scale the big symbol's art to fill its whole block?open

Render the symbol at the block size (e.g. a Spine scale) so it fills the whole NxM, not just the anchor cell.

Question page
How do I hold a big symbol while the rest of the board respins?open

Land the block, then spin({ holdReels: [its reels] }) so it survives the respin.

Question page
How do I tumble a big symbol down through the cascade intact?open

The cascade carries the block as a unit. Its tail falls through the strip into full view.

Question page
How do I split a big symbol into single symbols on a win?open

After the win, swap the block id for single ids via setSymbolAt or the next setResult.

Question page
How do I read the bounds of a big symbol block for an overlay?open

reelSet.getBlockBounds(col, row) returns the pixel rect of the whole block for an overlay.

Question page
How do I clip a big symbol that lands past the top or bottom edge?open

Buffer-anchored blocks that run past the top or bottom are clipped by the viewport mask automatically.

Question page
How do I let each reel land a different number of rows?open

Build with .multiways({ minCells, maxCells, reelExtent }) and pass per-reel visible arrays of different lengths to setResult.

Question page
How do I set a min and max row count per reel?open

.multiways({ minCells, maxCells, reelExtent }).

Question page
How do I compute and show the current ways count?open

Ways = the product of the per-reel row counts; read the shape from getVisibleGrid() lengths or your result.

Question page
How do I animate a reel growing from 2 to 7 rows mid-spin?open

Call reelSet.setShape(cellsPerReel) after spin() and before setResult(); it applies to that spin only, and throws if the result already arrived. The new geometry is committed under spin blur between the SPIN and STOP phases, so cell symbols resize instantly rather than tweening. shape:changed fires on setShape; adjust:start / adjust:complete fire per reel that has pin overlays to move.

Question page
How do I keep symbol size consistent as the row count changes?open

.multiways({ minCells, maxCells, reelExtent }) fixes the reel's pixel box, so symbols resize to fit whatever row count lands.

Question page
How do I run a cascade on a MultiWays board?open

Combine .multiways(...) with .tumble(...); the refills are shape-aware per reel.

Question page
How do I keep a pyramid (fixed jagged shape) instead of random cell counts?open

For a fixed jagged shape use .visibleCellsPerReel([...]) instead of MultiWays.

Question page
How do I anticipate on a tall reel that is about to grow?open

Call setAnticipation([reelIndex], options) for the reel about to grow. The reshape runs between SPIN and STOP, before the tease and before the reel lands, so the reel is already at its new size while it teases.

Question page
How do I combine MultiWays with big symbols safely?open

They are mutually exclusive: registering a big symbol (a size larger than 1x1) on a .multiways(...) slot throws at build time. Keep big symbols and MultiWays on separate ReelSets.

Question page
How do I play an idle/breathing loop while a symbol sits?open

Start an idle/breathing loop in the symbol's onActivate; SpineReelSymbol loops its idle animation by default.

Question page
How do I play a landing animation when a symbol settles?open

Play it from onReelLanded, or use SpineReelSymbol's autoPlayLanding + playLanding().

Question page
How do I switch a game between paylines and ways-to-win?open

Both are your evaluation choice. The engine lands a grid; you evaluate lines or ways over it.

Question page
How do I recompute the ways count when the board shape changes?open

Recompute ways as the product of row counts on shape:changed / adjust:complete.

Question page
How do I keep a 7x7 board with many masks from dropping frames?open

Use SharedRectMaskStrategy so one mask clips the whole board instead of one mask per cell.

Question page
How do I batch Spine instances so the GPU does not choke?open

Cache one Spine instance per id (as SpineReelSymbol does) and reuse it across swaps instead of recreating skeletons.

Question page