import { ReelSymbol } from '../symbols/ReelSymbol.js'; import { MotionBlurOptions, SpinTextureCache } from './SpinTextureCache.js'; export interface StaticSpinSymbolOptions { /** * Factory for the wrapped "live" symbol. any ReelSymbol subclass * (SpineReelSymbol, AnimatedSpriteSymbol, a custom class). The wrapper * owns the instance: it activates it while the reel is at rest and * deactivates it while the reel spins. */ createInner: () => ReelSymbol; /** Shared spin-texture cache. one per reel set. */ cache: SpinTextureCache; /** * What to show while spinning. `'blurred'` (default) crossfades the * static snapshot into the baked motion-blur variant; `'static'` shows * the crisp snapshot only and never touches the blur pipeline. */ spinTexture?: 'blurred' | 'static'; /** * Crossfade duration (ms) from crisp snapshot to blurred snapshot at * spin start. matches the reel's acceleration ramp. `0` = instant. * Default: 120. Ignored when `spinTexture: 'static'`. */ blurRampMs?: number; /** * Motion-blur tuning forwarded to `cache.captureBlurred`. `axis` defaults * to the owning set's travel axis, so a horizontal set smears sideways * without being told; pass it explicitly only to override that. The * sideways travel (and snapshots fit the cell by height instead of width). */ blur?: MotionBlurOptions; } /** * Wraps any `ReelSymbol` and swaps it for a cached snapshot texture while * the reel spins. "spin static, not Spine." * * At rest the inner symbol is live (idle loops, win animations, cascade * destruction all delegate to it). When the reel starts, the wrapper * snapshots the inner symbol through the shared {@link SpinTextureCache} * (or reuses a cached / user-provided texture), **deactivates** the inner * symbol so it costs nothing, and spins a plain Sprite instead. Symbols * that wrap in mid-spin only retarget that sprite's texture. no inner * symbol is ever created or ticked for them. On land the inner symbol is * reactivated on the final symbolId. * * With `spinTexture: 'blurred'` the sprite crossfades from the crisp * snapshot to a pre-baked motion-blur variant over `blurRampMs`, then * spins the blurred texture. The smear follows the reel's travel axis, * derived from the set's orientation (override with `blur.axis`). No * filter runs during the spin; the blur is baked once per symbolId and * cached. * * Register it like any other symbol: * * ```ts * const cache = new SpinTextureCache({ renderer: app.renderer }); * builder.symbols((r) => { * for (const id of ids) { * r.register(id, StaticSpinSymbol, { * createInner: () => new SpineReelSymbol(spineOpts), * cache, * }); * } * }); * ``` * * Prefer calling {@link prewarmSpinTextures} at load time so the first * spin doesn't pay the one-time capture cost. */ export declare class StaticSpinSymbol extends ReelSymbol { private _inner; private _cache; private _mode; private _rampMs; private _blurOpts; private _staticSprite; private _blurSprite; private _spinning; private _anticipating; private _cellW; private _cellH; private _rampTween; constructor(options: StaticSpinSymbolOptions); /** The wrapped live symbol. for type-specific access (`inner as SpineReelSymbol`). */ get inner(): ReelSymbol; /** True while the wrapper is showing a snapshot instead of the live symbol. */ get isShowingSnapshot(): boolean; protected onActivate(symbolId: string): void; protected onDeactivate(): void; onReelSpinStart(joinedMidSpin?: boolean): void; /** * The reel entered its anticipation tease: it is slow enough to read, so * crossfade the baked blur back out and ride the crisp snapshot until * the land. Mid-tease installs arrive blurred (`_showSnapshot` instant) * and immediately relax through this same hook. */ onReelAnticipationStart(): void; onReelSpinEnd(): void; onReelLanded(): void; playWin(): Promise; stopAnimation(): void; playDestroy(opts?: { delay?: number; signal?: AbortSignal; }): Promise; resize(width: number, height: number): void; protected onDestroy(): void; /** * Point the snapshot sprites at `symbolId`'s cached textures, capturing * on miss. With `instant`, the end state is applied directly (blurred * fully visible); otherwise the crisp→blur crossfade ramp starts. */ private _showSnapshot; /** * Static texture for `symbolId`, capturing from the inner symbol on a * cache miss. If the inner symbol currently holds a different identity * (mid-spin wrap), it is briefly activated offscreen for the capture and * deactivated again. one-time cost per symbolId; avoid it entirely with * `prewarmSpinTextures`. */ private _ensureStatic; private _hideSnapshot; /** * Uniformly fit both sprites to the cell along the axis the blur does * NOT pad (keeps aspect; the padded axis then centers out evenly past * the cell). Vertical reels fit by width; horizontal strips fit by * height. */ private _fitSprites; /** * Blur options with the smear axis resolved. * * The smear must follow the strip, so the default comes from the owning * set's orientation rather than being hardcoded to `'y'`. Before this, * a horizontal set using `StaticSpinSymbol` smeared vertically - across * the direction of travel - and nothing said so. An explicit * `blur.axis` still wins, for art that wants a deliberate cross-smear. */ private _resolvedBlur; private _killRamp; } //# sourceMappingURL=StaticSpinSymbol.d.ts.map