SharedRectMaskStrategy
pixi-reels / index / SharedRectMaskStrategy
Class: SharedRectMaskStrategy
Defined in: core/ReelViewport.ts:179
Single bounding-box mask covering every reel. Use this when symbols need to overlap across reel boundaries. typical for slots with big symbols that span multiple reels (a 2x2 bonus, a 3x3 giant) AND a non-zero cross-axis gap. Per-reel rects would clip those symbols at the gaps; a single shared rect keeps them visible.
Pyramid layouts using this strategy will show buffer cells past the ends of short reels (the “pyramid peek”. covered by frame art in production).
Example#
builder.maskStrategy(new SharedRectMaskStrategy())
Implements#
Constructors#
Constructor#
new SharedRectMaskStrategy(): SharedRectMaskStrategy;
Returns#
SharedRectMaskStrategy
Properties#
| Property | Modifier | Type | Default value | Description | Defined in |
|---|---|---|---|---|---|
version | readonly | 2 | MASK_STRATEGY_VERSION | Must equal MASK_STRATEGY_VERSION. Validated by ReelSetBuilder.maskStrategy(). | core/ReelViewport.ts:180 |
Methods#
build()#
build(ctx: MaskContext): Graphics;
Defined in: core/ReelViewport.ts:182
Build (or rebuild) the mask graphic. Returns the Graphics to use as the mask.
Parameters#
| Parameter | Type |
|---|---|
ctx | MaskContext |
Returns#
Graphics
Implementation of#
draw()#
draw(g: Graphics, ctx: MaskContext): void;
Defined in: core/ReelViewport.ts:197
Draw into a Graphics somebody else owns, so this strategy can be combined
by composeMasks(...) / inset(...). Does not clear.
Parameters#
| Parameter | Type |
|---|---|
g | Graphics |
ctx | MaskContext |
Returns#
void
update()#
update(g: Graphics, ctx: MaskContext): void;
Defined in: core/ReelViewport.ts:188
Update the mask when reel boxes resize (e.g. MultiWays reshape).
Parameters#
| Parameter | Type |
|---|---|
g | Graphics |
ctx | MaskContext |
Returns#
void