pixi-reels

MaskContext

pixi-reels


pixi-reels / index / MaskContext

Interface: MaskContext

Defined in: core/ReelViewport.ts:33

Everything a mask strategy is given. Passed as one object so the axis cannot be forgotten, and so later additions do not break the signature.

Properties#

PropertyModifierTypeDescriptionDefined in
axisreadonlyReelAxisThe set’s travel axis. axis.mainProp is the screen axis strips run along, so a strategy that rounds “the ends of each reel” can round the right two corners instead of guessing.core/ReelViewport.ts:45
bleedreadonlynumberCross-axis room, per side, that curveBleed asked for. Art wider than its cell hangs over by this much, so a strategy that clips to the board would cut it straight back off - the outermost reels worst of all, where the overhang leaves the board entirely. Inflate by it on the CROSS axis only: the main axis is where the buffer cells live, and they are meant to stay hidden. 0 unless ReelSetBuilder.curveBleed() was called.core/ReelViewport.ts:54
heightreadonlynumberViewport bounding-box height.core/ReelViewport.ts:39
origin?readonly{ x: number; y: number; }Screen-space offset every drawn shape should be shifted by. undefined (treated as { x: 0, y: 0 }) for a context the viewport built itself; set only by the inset(...) decorator, which shrinks rects and the viewport box and then uses this to move strategies that draw from (0, 0) rather than from a rect. A strategy that draws only from ctx.rects may ignore it - the rects are already shifted. A strategy that draws from ctx.width/ctx.height must add it, or inset will resize its mask without moving it.core/ReelViewport.ts:66
origin.xpublicnumber-core/ReelViewport.ts:66
origin.ypublicnumber-core/ReelViewport.ts:66
rectsreadonlyreadonly ReelMaskRect[]One rect per reel, in reel order. Empty before the builder supplies them.core/ReelViewport.ts:35
widthreadonlynumberViewport bounding-box width.core/ReelViewport.ts:37