HorizontalReelBuilder
pixi-reels / index / HorizontalReelBuilder
Class: HorizontalReelBuilder
Defined in: horizontal/HorizontalReelBuilder.ts:20
Fluent builder for HorizontalReel — the sideways “these symbols pay this round” banner reel above the reels.
Its API mirrors ReelSetBuilder: register .symbols(...), give it a
.ticker(...), and .build(). The reel then follows the engine’s spin
contract (spin() then setResult(ids)) plus a cascade(...) tumble. Only
.symbols(...) and .ticker(...) are required; everything else defaults
(a 4-wide, 72px, right-to-left reel — the 1×4 shape).
Constructors
Constructor
new HorizontalReelBuilder(): HorizontalReelBuilder;
Returns
HorizontalReelBuilder
Methods
build()
build(): HorizontalReel;
Defined in: horizontal/HorizontalReelBuilder.ts:110
Returns
cascadeTiming()
cascadeTiming(opts: HorizontalCascadeTiming): this;
Defined in: horizontal/HorizontalReelBuilder.ts:62
Drop/fall timing for cascade(...).
Parameters
| Parameter | Type |
|---|---|
opts | HorizontalCascadeTiming |
Returns
this
cellSize()
cellSize(
width: number,
height?: number,
opts?: {
gap?: number;
}): this;
Defined in: horizontal/HorizontalReelBuilder.ts:42
Cell dimensions. height defaults to width (square); gap defaults to 4.
Parameters
| Parameter | Type | Default value |
|---|---|---|
width | number | undefined |
height | number | width |
opts | { gap?: number; } | {} |
opts.gap? | number | undefined |
Returns
this
chrome()
chrome(draw: (g: Graphics, width: number, height: number) => void): this;
Defined in: horizontal/HorizontalReelBuilder.ts:93
Optional backing drawn behind the reel, sized to the visible window.
Parameters
| Parameter | Type |
|---|---|
draw | (g: Graphics, width: number, height: number) => void |
Returns
this
direction()
direction(direction: HorizontalDirection): this;
Defined in: horizontal/HorizontalReelBuilder.ts:50
Travel direction while spinning. rtl scrolls leftward (default), ltr rightward.
Parameters
| Parameter | Type |
|---|---|
direction | HorizontalDirection |
Returns
this
initialFrame()
initialFrame(frame: ColumnTarget[]): this;
Defined in: horizontal/HorizontalReelBuilder.ts:87
Rest frame shown before the first spin — the same ColumnTarget[] as
ReelSetBuilder.initialFrame. This reel is one column, so pass exactly one
entry whose visible holds visibleCount ids. Defaults to the first
visibleCount registered ids.
Parameters
| Parameter | Type |
|---|---|
frame | ColumnTarget[] |
Returns
this
rng()
rng(fn: () => number): this;
Defined in: horizontal/HorizontalReelBuilder.ts:99
Injected RNG for the spin blur (deterministic demos / tests).
Parameters
| Parameter | Type |
|---|---|
fn | () => number |
Returns
this
spinSpeed()
spinSpeed(pxPerFrame: number): this;
Defined in: horizontal/HorizontalReelBuilder.ts:56
Spin speed in pixels per frame. Default 22.
Parameters
| Parameter | Type |
|---|---|
pxPerFrame | number |
Returns
this
symbols()
symbols(configurator: (registry: SymbolRegistry) => void): this;
Defined in: horizontal/HorizontalReelBuilder.ts:76
Register the symbol classes shown on the reel, exactly like
ReelSetBuilder.symbols. The spin blur feeds from these ids; every id
passed to setResult(...) / cascade(...) must be registered here.
Required.
Parameters
| Parameter | Type |
|---|---|
configurator | (registry: SymbolRegistry) => void |
Returns
this
ticker()
ticker(ticker: Ticker): this;
Defined in: horizontal/HorizontalReelBuilder.ts:105
Drives the spin — required.
Parameters
| Parameter | Type |
|---|---|
ticker | Ticker |
Returns
this
visibleCount()
visibleCount(n: number): this;
Defined in: horizontal/HorizontalReelBuilder.ts:35
How many symbol cells are visible at once. Default 4 (the 1×4 strip).
Parameters
| Parameter | Type |
|---|---|
n | number |
Returns
this