Skip to main content
Version: Phaser v4.2.1

Types.GameObjects.Stencil

StencilConfig​

<static> StencilConfig​

nametypeoptionaldescription
childrenArray.<Phaser.GameObjects.GameObject>YesAn optional array of Game Objects to add to the Stencil.
optionsPhaser.Types.GameObjects.Stencil.StencilOptionsYesThe options for the Stencil.

Type: object

Member of: Phaser.Types.GameObjects.Stencil

Source: src/gameobjects/stencil/typedefs/StencilConfig.js#L1
Since: 4.2.0


StencilLayerMode​

<static> StencilLayerMode​

Type: 'addLayer' | 'subtractLayer' | 'clear' | 'clearRegion'

Member of: Phaser.Types.GameObjects.Stencil

Source: src/gameobjects/stencil/typedefs/StencilLayerModes.js#L1
Since: 4.2.0


StencilOptions​

<static> StencilOptions​

nametypeoptionaldefaultdescription
stencilAlphaStrategyPhaser.Types.Renderer.WebGL.AlphaStrategyYes"'dither'"The alpha strategy to use when rendering the stencil.
stencilClearValuenumberYes0The value to clear the stencil to, if the stencilLayerMode is clear or clearRegion. Must be between 0 and 255.
stencilCompositeCheckboolean | 'auto'Yes"'auto'"Whether to composite the contents of the stencil to a framebuffer.
stencilInvertbooleanYesfalseWhether to invert the stencil, using an extra draw call. This only works with the addLayer and subtractLayer modes.
stencilLayerModePhaser.Types.GameObjects.Stencil.StencilLayerModeYes"'addLayer'"The mode which the Stencil runs in.
stencilValueWrapbooleanYestrueWhether to wrap the value in the stencil buffer when it overflows or underflows when using the addLayer or subtractLayer mode. This is useful when defining stencils with subtraction, and you don't want to underflow from 0 to 255.

Type: object

Member of: Phaser.Types.GameObjects.Stencil

Source: src/gameobjects/stencil/typedefs/StencilOptions.js#L1
Since: 4.2.0