pixi-reels
All recipes

Bring your own blur textures

Seed the SpinTextureCache with hand-authored motion-blur textures from your atlas via setStatic/setBlurred. Provided art always wins and is never destroyed by the cache; ids without provided art fall back to the auto-bake — both spin through the same StaticSpinSymbol.

Loading recipe…

In this demo the round symbols use the atlas’s hand-authored motion-blur strips, while the royal symbols have no blur art at all — theirs is baked at prewarm. Watch a spin: both kinds blur, land crisp, and you can’t tell from the wiring which was which.

Provided art is authoritative

const cache = new SpinTextureCache({ renderer: app.renderer });

for (const id of AUTHORED_IDS) {
  cache.setStatic(id, textures[id]);        // shown before the blur ramps in
  cache.setBlurred(id, blurTextures[id]);   // spun at full speed
}

Two guarantees:

  • setStatic / setBlurred entries win over capturescaptureStatic and captureBlurred return them untouched, so a prewarm pass over all ids is safe.
  • The cache never destroys user-provided texturesinvalidate(), clear(), and destroy() only free the RenderTextures the cache itself generated. Your atlas stays intact.

Sizing rules

Snapshots draw center-anchored in the cell and fit by width (for the default vertical axis). Generated textures match the cell exactly; a hand-authored blur strip is typically the cell’s width and taller — it centers out of the cell evenly, exactly like the baked ones do via their padding.

When to bother with authored art

The auto-bake is a gaussian smear of the resting pose — production-correct and free. Reach for authored strips when the art direction wants more than that: ghosted double-exposures, streak highlights, or a completely different “spin state” drawing. You can mix per symbol, which is the point of this recipe.