pixi-reels

SharedRectMaskStrategy

pixi-reels


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#

PropertyModifierTypeDefault valueDescriptionDefined in
versionreadonly2MASK_STRATEGY_VERSIONMust 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#

ParameterType
ctxMaskContext

Returns#

Graphics

Implementation of#

MaskStrategy.build


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#

ParameterType
gGraphics
ctxMaskContext

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#

ParameterType
gGraphics
ctxMaskContext

Returns#

void

Implementation of#

MaskStrategy.update