pixi-reels
All mechanics

Mechanics

Spinning art

While a reel spins it shows a blurred still of each symbol, so heavy art costs nothing and reads as motion.

Demos

Each demo spins through StaticSpinSymbol. The first bakes the blur for plain cards, the second does the same for a Spine set, and the third uses blur frames drawn by hand.

Baked blur#

The cache snapshots each card once and bakes a motion blur from the snapshot, and the reels spin on those textures. There is no blur art in the demo, and no filter runs during the spin. prewarmSpinTextures bakes every id before the first spin so it does not stall.

Loading recipe…

Spine at rest#

At rest every cell is a live Spine skeleton with its idle and landing animations. When the reels start, each cell switches to a cached snapshot and the skeleton is deactivated, so no skeleton updates while the reels spin. On landing the skeletons come back and play their landing animation.

Loading recipe…

Your own blur art#

The round symbols use blur frames drawn in the atlas, handed to the cache with cache.setStatic(id, texture) and cache.setBlurred(id, texture). The cache uses those as they are and never bakes or destroys them. The royal symbols have no blur frames, so the cache bakes theirs. Both kinds spin through the same StaticSpinSymbol.

Loading recipe…

Concept

A symbol at rest can be anything: a Spine skeleton, an animated sprite, a container of layers. Register it through StaticSpinSymbol and give it a createInner that builds the real symbol. At rest the inner symbol is live, so idle loops and win animations play as usual. When the reel starts, the wrapper deactivates it and spins a plain sprite of it instead. On landing it brings the inner symbol back with the final id.

The sprite’s texture comes from a SpinTextureCache shared by the set, which snapshots each id once. With spinTexture: 'blurred', the default, it also bakes a motion blur along the reel’s travel and crossfades to it over blurRampMs. spinTexture: 'static' spins the sharp snapshot instead. No filter runs during the spin, and no skeleton updates while the strip moves.

prewarmSpinTextures bakes every id before the first spin. Without it, each id is baked the first time it is needed. If you have hand-drawn blur frames, cache.setBlurred(id, texture) makes the cache use them instead.

API

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

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

  • The configurator you call before every reel 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.

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

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

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

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

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.