pixi-reels
All mechanics

Mechanics

Layers

Draw a symbol over its neighbours or outside the reel frame, and build your own board out of the same cells.

Demos

The demos go from the smallest change to the largest: a zIndex inside one reel, unmasking above every reel, and raising one symbol while a win shows. The last demo builds a board out of cells with no reels.

Within one reel#

A zIndex in symbolData draws the scatter above the other symbols in its reel, so its art is never covered by the cell below. The mystery bush keeps the default layer, and the cell below it draws over its leaves. This orders symbols within the reel only. Art that reaches over the next reel or past the frame needs unmask.

Loading recipe…

Above every reel#

Unmasked symbols#

unmask: true in symbolData moves a landed symbol into the viewport’s unmaskedContainer, above every reel and outside the mask. The scatter’s art now spills past the grid edge and over the reel to its right, with no code in the demo. It works on jagged boards with centred reels too.

Loading recipe…

Buffer cells stay masked#

Only visible cells are unmasked. The same id in a buffer cell stays under the mask, so oversized art never hangs into the window from a cell the player should not see. The demo lands both at once and holds through a skip.

Loading recipe…

Your own draw order#

The engine orders symbols by type first: symbolData.zIndex * 100 plus the cell’s stacking index. Some art specs order by row first: within a grade the lower row is in front, then the reel to the right, and only then a higher grade. Pass that rule to symbolZIndex(resolver) and the engine applies it after every wrap, swap and landing.

Every mid and high symbol here is unmasked, so at rest they share one container and the resolver orders them against each other. While the reels move the resolver returns ctx.defaultZIndex, so the spin looks as it did before.

Loading recipe…

One symbol at a time#

With promote#

reelSet.promote(positions) raises the symbols at those positions above the mask and above their neighbours, and returns a function that drops them again. It attaches the views to a render layer instead of reparenting them, so nothing moves and nothing has to be put back. Unlike spotlight.show() it does not dim, does not call playWin() and has nothing to await, so the game’s own animation stays in control.

The same tween runs twice in the demo, once clipped and once promoted. Watch the top row swell past the grid edge.

Loading recipe…

By hand#

The older way to do the same thing. Each landed scatter’s view is moved into viewport.spotlightContainer, the layer the win spotlight uses, and handed back to its reel on the next spin:start. The recipe stores each view’s parent and position and restores them before the strip moves. Like promote, it raises one landed cell without making its id unmasked everywhere.

Loading recipe…

Assets provided by Thunderkick

Your own board#

BoardGrid is a grid of cells that each spin on their own. Hold & Win is built on it. This demo uses it directly for a reveal and collect prize grid: every cell spins to a prize, the values add up and the top cell is highlighted. There is no locking and no respin, because those are Hold & Win’s rules and this board has its own.

Loading recipe…

Concept

Every symbol lives inside its reel, and every reel sits under the viewport mask. That works until a symbol’s art is bigger than its cell, such as a scatter with a glow, a wild with a crown, or a winning symbol that should rise above the rest.

There are three ways out, from smallest to largest. A zIndex in the symbol’s data draws it above the other symbols in the same reel. Unmasking moves it to the layer above every reel and above the mask, so it can spill past the frame. Promoting raises one instance for as long as a win shows, then puts it back.

BoardGrid, in the last demo, is the same cell layout without the reels: a grid you fill and animate yourself.

API

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

  • 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…

  • Fluent builder for HoldAndWinBoard.

  • The configurator you call before every reel set.

  • Rounded-corner rectangles, per reel or per set.

  • 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.

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

  • 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…

  • Wininterface

    One "win" as the presenter sees it: an ordered set of cells to highlight.

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

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

Questions

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

No question is tagged with this mechanic yet.