pixi-reels 0.1.0 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +34 -0
- package/dist/cascade/CascadeAnticipationPhase.d.ts +23 -0
- package/dist/cascade/CascadeAnticipationPhase.d.ts.map +1 -0
- package/dist/cascade/DropRecipes.d.ts +40 -0
- package/dist/cascade/DropRecipes.d.ts.map +1 -0
- package/dist/config/types.d.ts +54 -0
- package/dist/config/types.d.ts.map +1 -1
- package/dist/core/Reel.d.ts +4 -0
- package/dist/core/Reel.d.ts.map +1 -1
- package/dist/core/ReelSet.d.ts +189 -3
- package/dist/core/ReelSet.d.ts.map +1 -1
- package/dist/core/ReelSetBuilder.d.ts +16 -0
- package/dist/core/ReelSetBuilder.d.ts.map +1 -1
- package/dist/events/ReelEvents.d.ts +48 -6
- package/dist/events/ReelEvents.d.ts.map +1 -1
- package/dist/frame/FrameBuilder.d.ts +1 -0
- package/dist/frame/FrameBuilder.d.ts.map +1 -1
- package/dist/index.cjs +4 -4
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +15 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +482 -58
- package/dist/index.js.map +1 -1
- package/dist/pins/CellPin.d.ts +82 -0
- package/dist/pins/CellPin.d.ts.map +1 -0
- package/dist/spin/phases/DropStartPhase.d.ts +21 -0
- package/dist/spin/phases/DropStartPhase.d.ts.map +1 -0
- package/dist/spin/phases/DropStopPhase.d.ts +44 -0
- package/dist/spin/phases/DropStopPhase.d.ts.map +1 -0
- package/dist/spin/phases/PhaseFactory.d.ts +13 -2
- package/dist/spin/phases/PhaseFactory.d.ts.map +1 -1
- package/dist/symbols/AnimatedSpriteSymbol.d.ts.map +1 -1
- package/dist/testing/testHarness.d.ts +4 -0
- package/dist/testing/testHarness.d.ts.map +1 -1
- package/dist/wins/Win.d.ts +7 -0
- package/dist/wins/Win.d.ts.map +1 -0
- package/dist/wins/WinPresenter.d.ts +100 -0
- package/dist/wins/WinPresenter.d.ts.map +1 -0
- package/package.json +1 -1
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
# pixi-reels
|
|
2
|
+
|
|
3
|
+
## 0.2.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [`3fd806a`](https://github.com/schmooky/pixi-reels/commit/3fd806a31d76be5fc6ac7ff8e23852814c542e1a) - Backfill for three engine PRs merged without changesets after `0.1.0`:
|
|
8
|
+
|
|
9
|
+
- Cascade drop-in mechanic and anticipation recipe ([#51](https://github.com/schmooky/pixi-reels/issues/51)).
|
|
10
|
+
- Engine primitives: `CellPin`, `movePin`, and `reelSet.frame` exposure ([#52](https://github.com/schmooky/pixi-reels/issues/52)).
|
|
11
|
+
- `ReelSet.getCellBounds` for overlays, paylines, and hit areas ([#53](https://github.com/schmooky/pixi-reels/issues/53)).
|
|
12
|
+
|
|
13
|
+
All three are additive, so this bundles them into a single minor bump.
|
|
14
|
+
|
|
15
|
+
- [`555c9f0`](https://github.com/schmooky/pixi-reels/commit/555c9f007d749a8e2329a53dc17208fc94d7b5f3) - Add: `WinPresenter` — a minimal win-presentation layer that animates winning cells and fires events. Paylines, cluster pops, scatter splashes all use the same shape. The library never draws lines or overlays; user code does that by reacting to events.
|
|
16
|
+
|
|
17
|
+
- `WinPresenter.show(wins: Win[])` — animates each win's cells, one by one. `stagger: 0` flashes simultaneously, `stagger > 0` sweeps left-to-right in cell order.
|
|
18
|
+
- `Win` — one shape: `{ cells: SymbolPosition[]; value?: number; kind?: string; id?: number }`. Covers paylines, clusters, cascade pops, scatters.
|
|
19
|
+
- `dimLosers` (default 0.35 alpha) fades non-winning cells during each win; restored on `win:end`.
|
|
20
|
+
- `symbolAnim`: `'win'` (default, calls `playWin()`), a named spine animation, or `(symbol, cell, win) => Promise<void>` for a custom callback.
|
|
21
|
+
- Events fire on `ReelSet.events`: `win:start` (full list), `win:group` (per-win), `win:symbol` (per-cell), `win:end` (`complete` / `aborted`). Subscribe with `reelSet.getCellBounds` to draw any overlay you want.
|
|
22
|
+
- Cascades: call `presenter.show([{ cells: winners }])` from `runCascade`'s `onWinnersVanish` hook — same API.
|
|
23
|
+
- Helper: `sortByValueDesc` exported for convenience.
|
|
24
|
+
- Types: `Win`, `SymbolPosition` (canonicalised to `config/types`, re-exported from events).
|
|
25
|
+
- Reels now have an explicit `container.zIndex = reelIndex` so the viewport's sorted `maskedContainer` draws reels deterministically — same order as before, but callers can flip it for bottom-left diagonal overflow.
|
|
26
|
+
|
|
27
|
+
No existing API is changed or removed.
|
|
28
|
+
|
|
29
|
+
### Patch Changes
|
|
30
|
+
|
|
31
|
+
- [`7792142`](https://github.com/schmooky/pixi-reels/commit/779214217bb341cfb66f2db74616b2e8608893b9) - Fix: Two `AnimatedSpriteSymbol` bugs that only manifest on symbols with non-trivial win animations:
|
|
32
|
+
|
|
33
|
+
- `resize()` now positions the sprite according to its configured anchor, so `anchor: { x: 0.5, y: 0.5 }` renders the symbol centred in its cell instead of with its centre pinned to the cell's top-left corner (which clipped three quarters of the symbol under the reel mask). `anchor: (0, 0)` — the prior default and only combination that worked — is unchanged.
|
|
34
|
+
- `playWin()` now returns the animation to frame 0 (`gotoAndStop(0)`) when the sequence completes, so the idle visible state settles on the neutral base frame. Previously the sprite held its last animation frame indefinitely — fine for symmetric pulses that happen to end where they started, a visible glitch for anything else (AI-generated or keyframe sequences that end mid-action).
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { ReelPhase } from '../spin/phases/ReelPhase.js';
|
|
2
|
+
/**
|
|
3
|
+
* Anticipation phase for cascade drop-in mechanics.
|
|
4
|
+
*
|
|
5
|
+
* The default AnticipationPhase slows a spinning reel — useless when
|
|
6
|
+
* the reel is stationary. This phase shakes the column instead, giving
|
|
7
|
+
* the player a clear "something's about to drop here" signal.
|
|
8
|
+
*
|
|
9
|
+
* Register it to replace the default for cascade games:
|
|
10
|
+
* builder.phases(f => f.register('anticipation', CascadeAnticipationPhase))
|
|
11
|
+
*
|
|
12
|
+
* Duration is driven by speed.anticipationDelay (same as standard anticipation).
|
|
13
|
+
*/
|
|
14
|
+
export declare class CascadeAnticipationPhase extends ReelPhase<void> {
|
|
15
|
+
readonly name = "anticipation";
|
|
16
|
+
readonly skippable = true;
|
|
17
|
+
private _tween;
|
|
18
|
+
private _baseX;
|
|
19
|
+
protected onEnter(): void;
|
|
20
|
+
update(_deltaMs: number): void;
|
|
21
|
+
protected onSkip(): void;
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=CascadeAnticipationPhase.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CascadeAnticipationPhase.d.ts","sourceRoot":"","sources":["../../src/cascade/CascadeAnticipationPhase.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,6BAA6B,CAAC;AAExD;;;;;;;;;;;GAWG;AACH,qBAAa,wBAAyB,SAAQ,SAAS,CAAC,IAAI,CAAC;IAC3D,QAAQ,CAAC,IAAI,kBAAkB;IAC/B,QAAQ,CAAC,SAAS,QAAQ;IAE1B,OAAO,CAAC,MAAM,CAAgC;IAC9C,OAAO,CAAC,MAAM,CAAK;IAEnB,SAAS,CAAC,OAAO,IAAI,IAAI;IA2BzB,MAAM,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI;IAE9B,SAAS,CAAC,MAAM,IAAI,IAAI;CAKzB"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Configuration for cascade drop-in behavior.
|
|
3
|
+
* Passed to ReelSetBuilder.cascade() to replace the default strip-spin mechanic.
|
|
4
|
+
*/
|
|
5
|
+
export interface CascadeDropConfig {
|
|
6
|
+
/** Stagger between rows dropping in (ms). 0 = all rows arrive simultaneously. Default: 0. */
|
|
7
|
+
rowDelay?: number;
|
|
8
|
+
/** Stagger between rows falling out (ms). 0 = all rows fall simultaneously. Default: 0. */
|
|
9
|
+
fallRowDelay?: number;
|
|
10
|
+
/** Distance symbols travel (px) — both falling out and dropping in. Default: auto (full column height). */
|
|
11
|
+
fromY?: number;
|
|
12
|
+
/** GSAP easing for the drop-in animation. Default: 'bounce.out'. */
|
|
13
|
+
easing?: string;
|
|
14
|
+
/** Duration of each symbol's drop-in animation (ms). 0 = instant. Default: 600. */
|
|
15
|
+
dropDuration?: number;
|
|
16
|
+
/** Duration of each symbol's fall-out animation (ms). 0 = skip fall. Default: 300. */
|
|
17
|
+
fallDuration?: number;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Named presets for common cascade drop patterns.
|
|
21
|
+
*
|
|
22
|
+
* Pass one to ReelSetBuilder.cascade():
|
|
23
|
+
* builder.cascade(DropRecipes.cascadeDrop)
|
|
24
|
+
*
|
|
25
|
+
* Control reel order per-spin with reelSet.setDropOrder():
|
|
26
|
+
* reelSet.setDropOrder('ltr') // left-to-right stagger
|
|
27
|
+
* reelSet.setDropOrder('rtl') // right-to-left stagger
|
|
28
|
+
* reelSet.setDropOrder('all') // all columns simultaneously
|
|
29
|
+
*/
|
|
30
|
+
export declare const DropRecipes: {
|
|
31
|
+
/** Old symbols fall out, then new ones drop in row by row with bounce. Classic cascade feel. */
|
|
32
|
+
readonly cascadeDrop: CascadeDropConfig;
|
|
33
|
+
/** Stiff landing — no bounce. Symbols fall out then drop in cleanly with a hard stop. */
|
|
34
|
+
readonly stiffDrop: CascadeDropConfig;
|
|
35
|
+
/** Old symbols fall out, then all new symbols in a column drop simultaneously. Good for refills. */
|
|
36
|
+
readonly simultaneousDrop: CascadeDropConfig;
|
|
37
|
+
/** Instant placement — no fall, no drop animation. Equivalent to slam-stop. */
|
|
38
|
+
readonly slamDrop: CascadeDropConfig;
|
|
39
|
+
};
|
|
40
|
+
//# sourceMappingURL=DropRecipes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DropRecipes.d.ts","sourceRoot":"","sources":["../../src/cascade/DropRecipes.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,WAAW,iBAAiB;IAChC,6FAA6F;IAC7F,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,2FAA2F;IAC3F,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,2GAA2G;IAC3G,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,oEAAoE;IACpE,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,mFAAmF;IACnF,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,sFAAsF;IACtF,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED;;;;;;;;;;GAUG;AACH,eAAO,MAAM,WAAW;IACtB,gGAAgG;0BACH,iBAAiB;IAE9G,yFAAyF;wBACE,iBAAiB;IAE5G,oGAAoG;+BACH,iBAAiB;IAElH,+EAA+E;uBAChB,iBAAiB;CACxE,CAAC"}
|
package/dist/config/types.d.ts
CHANGED
|
@@ -76,6 +76,60 @@ export interface Position {
|
|
|
76
76
|
x: number;
|
|
77
77
|
y: number;
|
|
78
78
|
}
|
|
79
|
+
/**
|
|
80
|
+
* Axis-aligned bounding box of a single grid cell in ReelSet-local
|
|
81
|
+
* coordinates. Returned by `reelSet.getCellBounds(col, row)`.
|
|
82
|
+
*
|
|
83
|
+
* Use this to draw paylines, hit areas, debug overlays, or any graphic
|
|
84
|
+
* that needs to align precisely with a visible symbol cell.
|
|
85
|
+
*/
|
|
86
|
+
export interface CellBounds {
|
|
87
|
+
/** Left edge of the cell in ReelSet-local pixels. */
|
|
88
|
+
x: number;
|
|
89
|
+
/** Top edge of the cell in ReelSet-local pixels. */
|
|
90
|
+
y: number;
|
|
91
|
+
/** Cell width — equals the configured symbol width. */
|
|
92
|
+
width: number;
|
|
93
|
+
/** Cell height — equals the configured symbol height. */
|
|
94
|
+
height: number;
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* A cell on the visible grid — `reelIndex` is the column, `rowIndex` the
|
|
98
|
+
* row from the top. This is the canonical grid-cell shape used across
|
|
99
|
+
* events (`win:symbol`, `spotlight:start`), `Spotlight.show`, and
|
|
100
|
+
* `ClusterWin.cells`.
|
|
101
|
+
*
|
|
102
|
+
* Named `SymbolPosition` for back-compat with the original events module.
|
|
103
|
+
*/
|
|
104
|
+
export interface SymbolPosition {
|
|
105
|
+
reelIndex: number;
|
|
106
|
+
rowIndex: number;
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* One "win" as the presenter sees it: an ordered set of cells to highlight.
|
|
110
|
+
*
|
|
111
|
+
* Use cases collapse onto this one shape — whether those cells came from a
|
|
112
|
+
* classic payline ("row 1 across all 5 reels"), a cascade pop ("this cluster
|
|
113
|
+
* vanished"), a scatter splash, or a bonus reveal.
|
|
114
|
+
*
|
|
115
|
+
* The presenter's job is to **animate these cells**. Anything beyond that —
|
|
116
|
+
* drawing a polyline, a cluster outline, a number popup, a sound cue — is
|
|
117
|
+
* user-land code reacting to the `win:*` events. pixi-reels never draws wins.
|
|
118
|
+
*
|
|
119
|
+
* Order of `cells` matters when `WinPresenter.stagger > 0` (e.g. a
|
|
120
|
+
* left-to-right sweep): cell N starts animating `stagger` ms after cell N-1.
|
|
121
|
+
* Pass the cells in the order you want the sweep to run.
|
|
122
|
+
*/
|
|
123
|
+
export interface Win {
|
|
124
|
+
/** Cells to highlight. Order matters when `stagger > 0`. */
|
|
125
|
+
cells: ReadonlyArray<SymbolPosition>;
|
|
126
|
+
/** Optional payout — used for the default value-desc sort. */
|
|
127
|
+
value?: number;
|
|
128
|
+
/** Optional tag for routing events to different handlers. */
|
|
129
|
+
kind?: string;
|
|
130
|
+
/** Optional stable id so event consumers can key per-win state. */
|
|
131
|
+
id?: number;
|
|
132
|
+
}
|
|
79
133
|
/** Mask configuration for the reel viewport. */
|
|
80
134
|
export interface MaskConfig {
|
|
81
135
|
mask: Container;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/config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IAClB,4DAA4D;IAC5D,KAAK,EAAE,aAAa,CAAC,cAAc,CAAC,CAAC;IACrC,8DAA8D;IAC9D,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,6DAA6D;IAC7D,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,mEAAmE;IACnE,EAAE,CAAC,EAAE,MAAM,CAAC;CACb;AAED,gDAAgD;AAChD,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,SAAS,CAAC;IAChB,QAAQ,EAAE,QAAQ,CAAC;CACpB;AAED,4DAA4D;AAC5D,MAAM,WAAW,qBAAqB;IACpC,IAAI,EAAE,QAAQ,CAAC,cAAc,CAAC,CAAC;IAC/B,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;IACpC,MAAM,EAAE,GAAG,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC;IAClC,YAAY,EAAE,MAAM,CAAC;IACrB,MAAM,EAAE,YAAY,CAAC;IACrB,MAAM,EAAE,MAAM,CAAC;CAChB"}
|
package/dist/core/Reel.d.ts
CHANGED
|
@@ -68,6 +68,10 @@ export declare class Reel implements Disposable {
|
|
|
68
68
|
get bufferAbove(): number;
|
|
69
69
|
get bufferBelow(): number;
|
|
70
70
|
get visibleRows(): number;
|
|
71
|
+
/** The symbol cell width (in pixels). Constant for the reel's lifetime. */
|
|
72
|
+
get symbolWidth(): number;
|
|
73
|
+
/** The symbol cell height (in pixels). Constant for the reel's lifetime. */
|
|
74
|
+
get symbolHeight(): number;
|
|
71
75
|
/** Update reel for one frame. Called by SpinController via ticker. */
|
|
72
76
|
update(deltaMs: number): void;
|
|
73
77
|
/** Set the target frame for stopping. */
|
package/dist/core/Reel.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Reel.d.ts","sourceRoot":"","sources":["../../src/core/Reel.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AACpC,OAAO,KAAK,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B,EACpC,QAAQ,EAAE,YAAY;IAgDxB,IAAI,WAAW,IAAI,OAAO,CAEzB;IAED,IAAI,UAAU,IAAI,OAAO,CAExB;IAED,IAAI,UAAU,CAAC,KAAK,EAAE,OAAO,EAE5B;IAED,IAAI,WAAW,IAAI,MAAM,CAExB;IAED,IAAI,WAAW,IAAI,MAAM,CAExB;IAED,IAAI,WAAW,IAAI,MAAM,CAExB;IAED,2EAA2E;IAC3E,IAAI,WAAW,IAAI,MAAM,CAExB;IAED,4EAA4E;IAC5E,IAAI,YAAY,IAAI,MAAM,CAEzB;IAED,sEAAsE;IACtE,MAAM,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI;IAc7B,yCAAyC;IACzC,YAAY,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,IAAI;IAInC,iEAAiE;IACjE,iBAAiB,IAAI,MAAM,EAAE;IAQ7B,gEAAgE;IAChE,WAAW,CAAC,UAAU,EAAE,MAAM,GAAG,UAAU;IAI3C,qEAAqE;IACrE,eAAe,IAAI,IAAI;IAMvB,sFAAsF;IACtF,aAAa,IAAI,IAAI;IAMrB,yEAAyE;IACzE,YAAY,IAAI,IAAI;IAMpB,gCAAgC;IAChC,UAAU,IAAI,IAAI;IAKlB,sEAAsE;IACtE,YAAY,CAAC,SAAS,EAAE,MAAM,EAAE,GAAG,IAAI;IAgBvC;;;;;;;;;;OAUG;IACH,aAAa,IAAI,IAAI;IAQrB,OAAO,IAAI,IAAI;IAYf,OAAO,CAAC,qBAAqB;IAc7B,OAAO,CAAC,gBAAgB;IAcxB,OAAO,CAAC,cAAc;CA8BvB"}
|
package/dist/core/ReelSet.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Container } from 'pixi.js';
|
|
2
2
|
import { Disposable } from '../utils/Disposable.js';
|
|
3
|
-
import { ReelSetInternalConfig } from '../config/types.js';
|
|
3
|
+
import { ReelSetInternalConfig, CellBounds } from '../config/types.js';
|
|
4
4
|
import { EventEmitter } from '../events/EventEmitter.js';
|
|
5
5
|
import { ReelSetEvents, SpinResult } from '../events/ReelEvents.js';
|
|
6
6
|
import { Reel } from './Reel.js';
|
|
@@ -8,9 +8,10 @@ import { ReelViewport } from './ReelViewport.js';
|
|
|
8
8
|
import { SpeedManager } from '../speed/SpeedManager.js';
|
|
9
9
|
import { SymbolSpotlight } from '../spotlight/SymbolSpotlight.js';
|
|
10
10
|
import { SymbolFactory } from '../symbols/SymbolFactory.js';
|
|
11
|
-
import { FrameBuilder } from '../frame/FrameBuilder.js';
|
|
11
|
+
import { FrameBuilder, FrameMiddleware } from '../frame/FrameBuilder.js';
|
|
12
12
|
import { PhaseFactory } from '../spin/phases/PhaseFactory.js';
|
|
13
13
|
import { SpinningMode } from '../spin/modes/SpinningMode.js';
|
|
14
|
+
import { CellPin, CellPinOptions, MovePinOptions, CellCoord } from '../pins/CellPin.js';
|
|
14
15
|
export interface ReelSetParams {
|
|
15
16
|
config: ReelSetInternalConfig;
|
|
16
17
|
reels: Reel[];
|
|
@@ -20,6 +21,19 @@ export interface ReelSetParams {
|
|
|
20
21
|
phaseFactory: PhaseFactory;
|
|
21
22
|
spinningMode: SpinningMode;
|
|
22
23
|
}
|
|
24
|
+
/**
|
|
25
|
+
* The runtime-mutable frame-builder pipeline exposed on `reelSet.frame`.
|
|
26
|
+
* Matches `FrameBuilder.use/remove` — the internal machinery that already
|
|
27
|
+
* exists; this is the ergonomic surface.
|
|
28
|
+
*/
|
|
29
|
+
export interface FrameAPI {
|
|
30
|
+
/** Add a middleware. Sorted by `priority` on next frame build. */
|
|
31
|
+
use(middleware: FrameMiddleware): void;
|
|
32
|
+
/** Remove a middleware by `name`. No-op if absent. */
|
|
33
|
+
remove(name: string): void;
|
|
34
|
+
/** Current middleware list in registration order. */
|
|
35
|
+
readonly middleware: ReadonlyArray<FrameMiddleware>;
|
|
36
|
+
}
|
|
23
37
|
/**
|
|
24
38
|
* The whole slot board as one object.
|
|
25
39
|
*
|
|
@@ -55,6 +69,8 @@ export interface ReelSetParams {
|
|
|
55
69
|
* Teardown cascades: one `reelSet.destroy()` disposes every child.
|
|
56
70
|
*/
|
|
57
71
|
export declare class ReelSet extends Container implements Disposable {
|
|
72
|
+
/** zIndex applied to pin overlays so they render above the reel strip. */
|
|
73
|
+
private static readonly PIN_OVERLAY_Z_INDEX;
|
|
58
74
|
private _events;
|
|
59
75
|
private _reels;
|
|
60
76
|
private _viewport;
|
|
@@ -62,13 +78,32 @@ export declare class ReelSet extends Container implements Disposable {
|
|
|
62
78
|
private _speedManager;
|
|
63
79
|
private _spotlight;
|
|
64
80
|
private _symbolFactory;
|
|
81
|
+
private _frameBuilder;
|
|
82
|
+
private _frameAPI;
|
|
65
83
|
private _isDestroyed;
|
|
84
|
+
private _pins;
|
|
85
|
+
/**
|
|
86
|
+
* Visual overlays rendered above the reel viewport while a spin is in
|
|
87
|
+
* motion. Each overlay is a pooled ReelSymbol sitting in the viewport's
|
|
88
|
+
* unmaskedContainer at the pin's cell position — it keeps the pinned
|
|
89
|
+
* symbol visible while the underlying reel scrolls. Created on
|
|
90
|
+
* spin:start, destroyed on spin:allLanded. The pin is co-stored so
|
|
91
|
+
* _destroyPinOverlay always has it available even after the pin is
|
|
92
|
+
* removed from `_pins` (e.g. during unpin()).
|
|
93
|
+
*/
|
|
94
|
+
private _pinOverlays;
|
|
66
95
|
constructor(params: ReelSetParams);
|
|
67
96
|
/** The event emitter for reel-specific events. */
|
|
68
97
|
get events(): EventEmitter<ReelSetEvents>;
|
|
69
98
|
/** Start spinning all reels. Returns a promise that resolves when all reels land. */
|
|
70
99
|
spin(): Promise<SpinResult>;
|
|
71
|
-
/**
|
|
100
|
+
/**
|
|
101
|
+
* Set the target result symbols. Triggers the stop sequence.
|
|
102
|
+
*
|
|
103
|
+
* If any pins are active (`reelSet.pin(...)`), their symbols are overlaid
|
|
104
|
+
* onto the result before it reaches the stop sequencer — so pinned cells
|
|
105
|
+
* always land on the pin's `symbolId` regardless of what the server sent.
|
|
106
|
+
*/
|
|
72
107
|
setResult(symbols: string[][]): void;
|
|
73
108
|
/** Set which reels should show anticipation before stopping. */
|
|
74
109
|
setAnticipation(reelIndices: number[]): void;
|
|
@@ -83,6 +118,22 @@ export declare class ReelSet extends Container implements Disposable {
|
|
|
83
118
|
setStopDelays(delays: number[]): void;
|
|
84
119
|
/** Skip/slam-stop: immediately land all reels on target. */
|
|
85
120
|
skip(): void;
|
|
121
|
+
/**
|
|
122
|
+
* Set the drop order for cascade drop-in mechanics.
|
|
123
|
+
*
|
|
124
|
+
* A convenience wrapper over setStopDelays() for common patterns.
|
|
125
|
+
* The stagger step defaults to the active speed profile's stopDelay
|
|
126
|
+
* (or 150 ms if stopDelay is 0).
|
|
127
|
+
*
|
|
128
|
+
* Call this before or after setResult() — both work.
|
|
129
|
+
*
|
|
130
|
+
* @example
|
|
131
|
+
* reelSet.setDropOrder('ltr'); // left-to-right
|
|
132
|
+
* reelSet.setDropOrder('rtl'); // right-to-left
|
|
133
|
+
* reelSet.setDropOrder('all'); // all columns simultaneously
|
|
134
|
+
* reelSet.setDropOrder([0, 0, 200, 200, 400]); // custom per-reel delays
|
|
135
|
+
*/
|
|
136
|
+
setDropOrder(order: 'ltr' | 'rtl' | 'all' | number[], stepMs?: number): void;
|
|
86
137
|
get isSpinning(): boolean;
|
|
87
138
|
/** Speed profile manager. */
|
|
88
139
|
get speed(): SpeedManager;
|
|
@@ -93,9 +144,144 @@ export declare class ReelSet extends Container implements Disposable {
|
|
|
93
144
|
get reels(): readonly Reel[];
|
|
94
145
|
/** Get a reel by index. */
|
|
95
146
|
getReel(index: number): Reel;
|
|
147
|
+
/**
|
|
148
|
+
* Returns the bounding box of a visible grid cell in ReelSet-local
|
|
149
|
+
* coordinates (i.e. relative to this Container, before any parent
|
|
150
|
+
* transforms). Row 0 is the top visible row.
|
|
151
|
+
*
|
|
152
|
+
* Use this to place payline graphics, hit areas, or debug overlays
|
|
153
|
+
* that must align with a specific symbol cell:
|
|
154
|
+
*
|
|
155
|
+
* ```ts
|
|
156
|
+
* const b = reelSet.getCellBounds(2, 1);
|
|
157
|
+
* gfx.rect(b.x, b.y, b.width, b.height).stroke({ color: 0xff6b35 });
|
|
158
|
+
* reelSet.addChild(gfx);
|
|
159
|
+
* ```
|
|
160
|
+
*
|
|
161
|
+
* To convert to stage / global coordinates use PixiJS:
|
|
162
|
+
* ```ts
|
|
163
|
+
* const global = reelSet.toGlobal({ x: b.x, y: b.y });
|
|
164
|
+
* ```
|
|
165
|
+
*/
|
|
166
|
+
getCellBounds(col: number, row: number): CellBounds;
|
|
96
167
|
/** Get the viewport. */
|
|
97
168
|
get viewport(): ReelViewport;
|
|
169
|
+
/**
|
|
170
|
+
* Pin a symbol to a grid cell. Applied immediately if the reel is idle;
|
|
171
|
+
* applied at the next `setResult()` otherwise. Fires `pin:placed`.
|
|
172
|
+
*
|
|
173
|
+
* Passing the same `(col, row)` replaces the previous pin — the old one
|
|
174
|
+
* is replaced silently (no `pin:expired` fires for replacement).
|
|
175
|
+
*
|
|
176
|
+
* @example
|
|
177
|
+
* // Sticky wild for 3 spins
|
|
178
|
+
* reelSet.pin(2, 1, 'wild', { turns: 3 })
|
|
179
|
+
*
|
|
180
|
+
* // Hold & Win coin with a payout value
|
|
181
|
+
* reelSet.pin(col, row, 'coin', { turns: 'permanent', payload: { value: 50 } })
|
|
182
|
+
*
|
|
183
|
+
* // Expanding wild — fill column for the current spin's evaluation only
|
|
184
|
+
* for (let r = 0; r < 3; r++) reelSet.pin(2, r, 'wild', { turns: 'eval' })
|
|
185
|
+
*/
|
|
186
|
+
pin(col: number, row: number, symbolId: string, options?: CellPinOptions): CellPin;
|
|
187
|
+
/**
|
|
188
|
+
* Remove a pin at `(col, row)`. If no pin exists at that cell, this is a
|
|
189
|
+
* no-op. Fires `pin:expired` with reason `'explicit'`.
|
|
190
|
+
*/
|
|
191
|
+
unpin(col: number, row: number): void;
|
|
192
|
+
/**
|
|
193
|
+
* All active pins, keyed by `"col:row"`.
|
|
194
|
+
*
|
|
195
|
+
* Reads are safe at any time — during a spin the map reflects pins that
|
|
196
|
+
* will apply to the NEXT `setResult()`, not the one already in flight.
|
|
197
|
+
*/
|
|
198
|
+
get pins(): ReadonlyMap<string, CellPin>;
|
|
199
|
+
/** Convenience: get the pin at `(col, row)` or `undefined`. */
|
|
200
|
+
getPin(col: number, row: number): CellPin | undefined;
|
|
201
|
+
/**
|
|
202
|
+
* Move an existing pin from one cell to another. Animates a flight symbol
|
|
203
|
+
* between the two cells, updates pin state atomically, and resolves when
|
|
204
|
+
* the animation completes.
|
|
205
|
+
*
|
|
206
|
+
* This is the engine-native replacement for ghost sprites in walking-wild
|
|
207
|
+
* recipes. The flight symbol is a pooled `ReelSymbol` acquired from the
|
|
208
|
+
* factory, parented briefly to the viewport's `unmaskedContainer` so it
|
|
209
|
+
* can travel across reel boundaries without being clipped.
|
|
210
|
+
*
|
|
211
|
+
* Constraints:
|
|
212
|
+
* - Only callable at rest (throws if `isSpinning === true`).
|
|
213
|
+
* - `to` must be within the grid; no pin may already exist there.
|
|
214
|
+
* - Calling with `from === to` is a no-op that still fires `pin:moved`.
|
|
215
|
+
*
|
|
216
|
+
* @example
|
|
217
|
+
* // Walking wild — move the pinned wild one column left each spin
|
|
218
|
+
* reelSet.events.on('spin:complete', async () => {
|
|
219
|
+
* for (const pin of [...reelSet.pins.values()]) {
|
|
220
|
+
* if (pin.col > 0) {
|
|
221
|
+
* await reelSet.movePin(
|
|
222
|
+
* { col: pin.col, row: pin.row },
|
|
223
|
+
* { col: pin.col - 1, row: pin.row },
|
|
224
|
+
* );
|
|
225
|
+
* } else {
|
|
226
|
+
* reelSet.unpin(pin.col, pin.row);
|
|
227
|
+
* }
|
|
228
|
+
* }
|
|
229
|
+
* });
|
|
230
|
+
*/
|
|
231
|
+
movePin(from: CellCoord, to: CellCoord, opts?: MovePinOptions): Promise<void>;
|
|
232
|
+
/**
|
|
233
|
+
* Runtime-mutable middleware pipeline for symbol-frame generation.
|
|
234
|
+
*
|
|
235
|
+
* @example
|
|
236
|
+
* // Feature entry — swap to a middleware that injects more wilds
|
|
237
|
+
* reelSet.frame.use(moreWildsMiddleware);
|
|
238
|
+
*
|
|
239
|
+
* // Feature exit
|
|
240
|
+
* reelSet.frame.remove('more-wilds');
|
|
241
|
+
*/
|
|
242
|
+
get frame(): FrameAPI;
|
|
98
243
|
get isDestroyed(): boolean;
|
|
99
244
|
destroy(): void;
|
|
245
|
+
/**
|
|
246
|
+
* Return a deep copy of `symbols` with active pins overlaid. Pure — does
|
|
247
|
+
* not mutate the input. When there are no pins, returns the input as-is
|
|
248
|
+
* (fast path; identical behaviour to pre-pin code).
|
|
249
|
+
*/
|
|
250
|
+
private _applyPinsToGrid;
|
|
251
|
+
/**
|
|
252
|
+
* Apply a pin to the idle reel's visible display immediately. Used when
|
|
253
|
+
* `pin()` is called while no spin is in flight — the grid updates right
|
|
254
|
+
* away so `getVisibleSymbols()` reflects the pin.
|
|
255
|
+
*/
|
|
256
|
+
private _applyPinVisually;
|
|
257
|
+
/**
|
|
258
|
+
* Fires on `spin:allLanded`. Destroys visual pin overlays (the actual reel
|
|
259
|
+
* cells now show the pinned symbols via setResult overlay), then
|
|
260
|
+
* decrements numeric-turns pins and expires pins that hit zero.
|
|
261
|
+
*/
|
|
262
|
+
private _onSpinLanded;
|
|
263
|
+
/**
|
|
264
|
+
* Fires on `spin:start`. Clears every `'eval'` pin from the previous spin,
|
|
265
|
+
* then creates a visual overlay for every remaining pin so its symbol
|
|
266
|
+
* stays visible while the reel scrolls underneath.
|
|
267
|
+
*/
|
|
268
|
+
private _onSpinStart;
|
|
269
|
+
/**
|
|
270
|
+
* Create an overlay ReelSymbol for a pin in the viewport's unmasked
|
|
271
|
+
* container. No-op if one already exists at that cell. Fires
|
|
272
|
+
* `pin:overlayCreated` after the overlay is positioned and added to the
|
|
273
|
+
* display list — that's the hook consumers use to drive animation state
|
|
274
|
+
* (e.g. setting a Spine track).
|
|
275
|
+
*/
|
|
276
|
+
private _ensurePinOverlay;
|
|
277
|
+
/**
|
|
278
|
+
* Destroy a single pin's overlay, if present. Fires
|
|
279
|
+
* `pin:overlayDestroyed` BEFORE the overlay is released to the pool, so
|
|
280
|
+
* consumers can stop animations / remove listeners on a still-valid
|
|
281
|
+
* instance.
|
|
282
|
+
*/
|
|
283
|
+
private _destroyPinOverlay;
|
|
284
|
+
/** Destroy every active pin overlay. Called on spin land and on destroy. */
|
|
285
|
+
private _destroyAllPinOverlays;
|
|
100
286
|
}
|
|
101
287
|
//# sourceMappingURL=ReelSet.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ReelSet.d.ts","sourceRoot":"","sources":["../../src/core/ReelSet.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAEpC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,KAAK,EAAgB,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"ReelSet.d.ts","sourceRoot":"","sources":["../../src/core/ReelSet.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAEpC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,KAAK,EAAgB,qBAAqB,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAC1F,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,KAAK,EAAE,aAAa,EAAE,UAAU,EAAkB,MAAM,yBAAyB,CAAC;AACzF,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEjD,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AACxD,OAAO,EAAE,eAAe,EAA0D,MAAM,iCAAiC,CAAC;AAC1H,OAAO,KAAK,EAAE,aAAa,E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3B;IASD;;;;;;;;;;;;;;;;OAgBG;IACH,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,OAAO;IAuClF;;;OAGG;IACH,KAAK,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,IAAI;IASrC;;;;;OAKG;IACH,IAAI,IAAI,IAAI,WAAW,CAAC,MAAM,EAAE,OAAO,CAAC,CAEvC;IAED,+DAA+D;IAC/D,MAAM,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,GAAG,SAAS;IAIrD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA6BG;IACG,OAAO,CACX,IAAI,EAAE,SAAS,EACf,EAAE,EAAE,SAAS,EACb,IAAI,CAAC,EAAE,cAAc,GACpB,OAAO,CAAC,IAAI,CAAC;IA+HhB;;;;;;;;;OASG;IACH,IAAI,KAAK,IAAI,QAAQ,CAEpB;IAID,IAAI,WAAW,IAAI,OAAO,CAEzB;IAED,OAAO,IAAI,IAAI;IAuBf;;;;OAIG;IACH,OAAO,CAAC,gBAAgB;IAYxB;;;;OAIG;IACH,OAAO,CAAC,iBAAiB;IAQzB;;;;OAIG;IACH,OAAO,CAAC,aAAa;IAsBrB;;;;OAIG;IACH,OAAO,CAAC,YAAY;IAqBpB;;;;;;OAMG;IACH,OAAO,CAAC,iBAAiB;IAkBzB;;;;;OAKG;IACH,OAAO,CAAC,kBAAkB;IAU1B,4EAA4E;IAC5E,OAAO,CAAC,sBAAsB;CAI/B"}
|
|
@@ -5,6 +5,7 @@ import { SymbolRegistry } from '../symbols/SymbolRegistry.js';
|
|
|
5
5
|
import { PhaseFactory } from '../spin/phases/PhaseFactory.js';
|
|
6
6
|
import { SpinningMode } from '../spin/modes/SpinningMode.js';
|
|
7
7
|
import { FrameMiddleware } from '../frame/FrameBuilder.js';
|
|
8
|
+
import { CascadeDropConfig } from '../cascade/DropRecipes.js';
|
|
8
9
|
/**
|
|
9
10
|
* The configurator you call before every reel set.
|
|
10
11
|
*
|
|
@@ -53,6 +54,7 @@ export declare class ReelSetBuilder {
|
|
|
53
54
|
private _middlewares;
|
|
54
55
|
private _initialFrame?;
|
|
55
56
|
private _symbolDataOverrides;
|
|
57
|
+
private _cascadeDropConfig?;
|
|
56
58
|
/** Set number of reel columns. */
|
|
57
59
|
reels(count: number): this;
|
|
58
60
|
/** Set number of visible symbol rows per reel. */
|
|
@@ -93,6 +95,20 @@ export declare class ReelSetBuilder {
|
|
|
93
95
|
frameMiddleware(middleware: FrameMiddleware): this;
|
|
94
96
|
/** Override default phases. */
|
|
95
97
|
phases(configurator: (factory: PhaseFactory) => void): this;
|
|
98
|
+
/**
|
|
99
|
+
* Enable cascade drop-in mechanics.
|
|
100
|
+
*
|
|
101
|
+
* Replaces the strip-spin + bounce stop cycle with a stationary wait
|
|
102
|
+
* followed by symbols dropping in from above the viewport.
|
|
103
|
+
*
|
|
104
|
+
* Usage is identical to standard spin — `spin()` / `setResult()` / `await`.
|
|
105
|
+
* Use `reelSet.setDropOrder()` to control which columns drop first.
|
|
106
|
+
*
|
|
107
|
+
* @example
|
|
108
|
+
* import { DropRecipes } from 'pixi-reels';
|
|
109
|
+
* builder.cascade(DropRecipes.cascadeDrop)
|
|
110
|
+
*/
|
|
111
|
+
cascade(config: CascadeDropConfig): this;
|
|
96
112
|
/** Set the initial symbol grid (visible symbols only). */
|
|
97
113
|
initialFrame(frame: string[][]): this;
|
|
98
114
|
/** Build the ReelSet. Validates configuration and assembles all internal objects. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ReelSetBuilder.d.ts","sourceRoot":"","sources":["../../src/core/ReelSetBuilder.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AACtC,OAAO,KAAK,EAAE,YAAY,EAAE,UAAU,EAAE,YAA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C,MAAM,EAAE,MAAM,GAAG,IAAI;IAK5B,oDAAoD;IACpD,YAAY,CAAC,IAAI,EAAE,YAAY,GAAG,IAAI;IAKtC,mCAAmC;IACnC,eAAe,CAAC,UAAU,EAAE,eAAe,GAAG,IAAI;IAKlD,+BAA+B;IAC/B,MAAM,CAAC,YAAY,EAAE,CAAC,OAAO,EAAE,YAAY,KAAK,IAAI,GAAG,IAAI;IAK3D;;;;;;;;;;;;OAYG;IACH,OAAO,CAAC,MAAM,EAAE,iBAAiB,GAAG,IAAI;IAKxC,0DAA0D;IAC1D,YAAY,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE,GAAG,IAAI;IAKrC,qFAAqF;IACrF,KAAK,IAAI,OAAO;IAmHhB,OAAO,CAAC,SAAS;CA6BlB"}
|
|
@@ -1,9 +1,6 @@
|
|
|
1
|
-
import { SpeedProfile } from '../config/types.js';
|
|
2
|
-
|
|
3
|
-
export
|
|
4
|
-
reelIndex: number;
|
|
5
|
-
rowIndex: number;
|
|
6
|
-
}
|
|
1
|
+
import { SpeedProfile, Win, SymbolPosition } from '../config/types.js';
|
|
2
|
+
import { CellPin, PinExpireReason } from '../pins/CellPin.js';
|
|
3
|
+
export type { SymbolPosition };
|
|
7
4
|
/** Result returned when a spin completes. */
|
|
8
5
|
export interface SpinResult {
|
|
9
6
|
/** Final symbol grid [reelIndex][rowIndex]. */
|
|
@@ -26,6 +23,51 @@ export interface ReelSetEvents extends Record<string, unknown[]> {
|
|
|
26
23
|
'speed:changed': [profile: SpeedProfile, previous: SpeedProfile];
|
|
27
24
|
'spotlight:start': [positions: SymbolPosition[]];
|
|
28
25
|
'spotlight:end': [];
|
|
26
|
+
/**
|
|
27
|
+
* WinPresenter started a sequence. Fires once per `show()` call, with
|
|
28
|
+
* the full list of wins in the order they'll be shown (sorted by
|
|
29
|
+
* `value` desc by default).
|
|
30
|
+
*/
|
|
31
|
+
'win:start': [wins: readonly Win[]];
|
|
32
|
+
/**
|
|
33
|
+
* A single win is now being presented. Fires once per win per cycle —
|
|
34
|
+
* before `win:symbol` fires for its cells. Subscribe to draw per-win
|
|
35
|
+
* visuals (payline polyline, cluster outline, number popup) using
|
|
36
|
+
* `reelSet.getCellBounds(col, row)`.
|
|
37
|
+
*/
|
|
38
|
+
'win:group': [win: Win, cells: readonly SymbolPosition[]];
|
|
39
|
+
/**
|
|
40
|
+
* A specific cell is being animated. Fires once per cell per win per
|
|
41
|
+
* cycle. `symbol` is typed as `unknown` to keep this module free of
|
|
42
|
+
* symbol-layer imports; cast to `ReelSymbol` (or your subclass).
|
|
43
|
+
* When `WinPresenter.stagger > 0`, successive cells fire this event
|
|
44
|
+
* one after another with that gap.
|
|
45
|
+
*/
|
|
46
|
+
'win:symbol': [symbol: unknown, cell: SymbolPosition, win: Win];
|
|
47
|
+
/** WinPresenter finished — either naturally (`complete`) or via abort. */
|
|
48
|
+
'win:end': [reason: 'complete' | 'aborted'];
|
|
49
|
+
'pin:placed': [pin: CellPin];
|
|
50
|
+
'pin:moved': [pin: CellPin, from: {
|
|
51
|
+
col: number;
|
|
52
|
+
row: number;
|
|
53
|
+
}];
|
|
54
|
+
'pin:expired': [pin: CellPin, reason: PinExpireReason];
|
|
55
|
+
/**
|
|
56
|
+
* Fires whenever the engine creates a visual overlay symbol for a pin
|
|
57
|
+
* during a spin's motion phase. The `overlay` argument is the pooled
|
|
58
|
+
* ReelSymbol instance — typed as `unknown` here to keep this module
|
|
59
|
+
* free of symbol-layer imports; cast to your concrete symbol class.
|
|
60
|
+
*
|
|
61
|
+
* Use this hook to drive animation state on the overlay (e.g. set a
|
|
62
|
+
* Spine animation track). The overlay is recycled on `pin:overlayDestroyed`.
|
|
63
|
+
*/
|
|
64
|
+
'pin:overlayCreated': [pin: CellPin, overlay: unknown];
|
|
65
|
+
/**
|
|
66
|
+
* Fires when the engine is about to release a pin's visual overlay
|
|
67
|
+
* back to the pool (on spin:allLanded, unpin, or pin replacement).
|
|
68
|
+
* Use this hook to stop any animations or listeners you attached.
|
|
69
|
+
*/
|
|
70
|
+
'pin:overlayDestroyed': [pin: CellPin, overlay: unknown];
|
|
29
71
|
'destroyed': [];
|
|
30
72
|
}
|
|
31
73
|
/** Events emitted by an individual Reel. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ReelEvents.d.ts","sourceRoot":"","sources":["../../src/events/ReelEvents.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"ReelEvents.d.ts","sourceRoot":"","sources":["../../src/events/ReelEvents.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,YAAY,EACZ,GAAG,EACH,cAAc,EACf,MAAM,oBAAoB,CAAC;AAC5B,OAAO,KAAK,EAAE,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAInE,YAAY,EAAE,cAAc,EAAE,CAAC;AAE/B,6CAA6C;AAC7C,MAAM,WAAW,UAAU;IACzB,+CAA+C;IAC/C,OAAO,EAAE,MAAM,EAAE,EAAE,CAAC;IACpB,iDAAiD;IACjD,UAAU,EAAE,OAAO,CAAC;IACpB,2CAA2C;IAC3C,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,mCAAmC;AACnC,MAAM,WAAW,aAAc,SAAQ,MAAM,CAAC,MAAM,EAAE,OAAO,EAAE,CAAC;IAC9D,YAAY,EAAE,EAAE,CAAC;IACjB,iBAAiB,EAAE,EAAE,CAAC;IACtB,eAAe,EAAE,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC;IACrC,iBAAiB,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,CAAC,CAAC;IAC1D,gBAAgB,EAAE,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;IACvC,eAAe,EAAE,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;IACtC,gBAAgB,EAAE,EAAE,CAAC;IACrB,gBAAgB,EAAE,EAAE,CAAC;IACrB,eAAe,EAAE,CAAC,OAAO,EAAE,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gBAAgB,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,CAAC,CAAC;IAClD,iBAAiB,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,CAAC,CAAC;IACnD,QAAQ,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,CAAC,CAAC;IAC9B,WAAW,EAAE,EAAE,CAAC;CACjB"}
|
|
@@ -46,5 +46,6 @@ export declare class FrameBuilder {
|
|
|
46
46
|
/** Build frames for all reels. */
|
|
47
47
|
buildAll(reelCount: number, visibleRows: number, bufferAbove: number, bufferBelow: number, targetSymbols?: string[][], isSpinning?: boolean): string[][];
|
|
48
48
|
get randomProvider(): RandomSymbolProvider;
|
|
49
|
+
get middleware(): ReadonlyArray<FrameMiddleware>;
|
|
49
50
|
}
|
|
50
51
|
//# sourceMappingURL=FrameBuilder.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FrameBuilder.d.ts","sourceRoot":"","sources":["../../src/frame/FrameBuilder.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AAEtE,sDAAsD;AACtD,MAAM,WAAW,YAAY;IAC3B,yBAAyB;IACzB,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,0BAA0B;IAC1B,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,yCAAyC;IACzC,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,yCAAyC;IACzC,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,uFAAuF;IACvF,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,yEAAyE;IACzE,QAAQ,CAAC,aAAa,CAAC,EAAE,MAAM,EAAE,CAAC;IAClC,8CAA8C;IAC9C,QAAQ,CAAC,UAAU,EAAE,OAAO,CAAC;IAC7B,4DAA4D;IAC5D,QAAQ,EAAE,MAAM,CAA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