PR pixi-reels

SharedRectMaskStrategy

pixi-reels


pixi-reels / index / SharedRectMaskStrategy

Class: SharedRectMaskStrategy

Defined in: core/ReelViewport.ts:93

Single bounding-box mask covering every reel’s tallest extent. Use this when symbols need to overlap across reel boundaries. typical for slots with big symbols that span multiple columns (a 2×2 bonus, a 3×3 giant) AND a non-zero symbolGap.x. Per-reel rects would clip those symbols at the column gaps; a single shared rect keeps them visible.

Pyramid layouts using this strategy will show buffer rows above/below short reels (the “pyramid peek”. covered by frame art in production).

Example

builder.maskStrategy(new SharedRectMaskStrategy())

Implements

Constructors

Constructor

new SharedRectMaskStrategy(): SharedRectMaskStrategy;

Returns

SharedRectMaskStrategy

Methods

build()

build(
   rects: ReelMaskRect[], 
   totalWidth: number, 
   totalHeight: number): Graphics;

Defined in: core/ReelViewport.ts:94

Build (or rebuild) the mask graphic. Returns the Graphics to use as the mask.

Parameters

ParameterType
rectsReelMaskRect[]
totalWidthnumber
totalHeightnumber

Returns

Graphics

Implementation of

MaskStrategy.build


update()

update(
   g: Graphics, 
   rects: ReelMaskRect[], 
   totalWidth: number, 
   totalHeight: number): void;

Defined in: core/ReelViewport.ts:100

Update the mask when reel boxes resize (e.g. MultiWays reshape).

Parameters

ParameterType
gGraphics
rectsReelMaskRect[]
totalWidthnumber
totalHeightnumber

Returns

void

Implementation of

MaskStrategy.update