Software Development
Masks And Stencils
Masking in Phaser 4: the Mask filter (enableFilters, then filters.internal or filters.external.addMask with a Game Object or texture key, invert, autoUpdate, hardEdges for Graphics and Shape masks), Stencil and StencilReference (addLayer, subtractLayer, clear, clearRegion, stencilInvert), CustomContext (scissor, stencil test, alpha strategy), the render config's alphaStrategy, stencil and stencilAlphaStrategy, and the Canvas-only GeometryMask. Use when masking a sprite, container or camera, cutting a hole in a dark overlay, a spotlight or keyhole, fog of war, a reveal or wipe, a circular minimap or avatar, or clipping a scrolling UI panel. v3's BitmapMask and createBitmapMask don't exist in v4, and setMask only works in Canvas. Triggers on: mask, masking, setMask, BitmapMask, GeometryMask, createGeometryMask, invertAlpha, inverted mask, hole, cut-out, clip, clipping, scissor, stencil, Stencil, StencilReference, CustomContext, alphaStrategy, dither.
- Publisher / source
- phaserjs/phaser (found on skills.sh)
- Upstream record
- phaserjs/phaser
- Version
- Version 1
- Published
- Publication review
- Approved for publication
- Content fingerprint
eab68b57b4b8fd3132c00be3ba14d08cb4d275a67dc9401f57bda72a0bffb9ea