pixi-jsInterfaces
Interface: MaskOptions
Defined in: node_modules/pixi.js/lib/scene/container/container-mixins/effectsMixin.d.ts:72
Options for configuring mask behavior on a display object.
Example
// Basic mask inversion
sprite.setMask({
mask: graphics,
inverse: true
});
See
- Container#setMask For applying masks with options
- Container#mask For basic masking
Standard
Extended by
Properties
channel?
> optional channel?: MaskChannel
Defined in: node_modules/pixi.js/lib/scene/container/container-mixins/effectsMixin.d.ts:100
Which channel of the mask texture to use for masking.
'red'uses the red channel (default). Suitable for grayscale mask textures.'alpha'uses the alpha channel. Suitable for sprites with transparency.
Default
'red'
Example
sprite.setMask({
mask: maskSprite,
channel: 'alpha',
});
inverse
> inverse: boolean
Defined in: node_modules/pixi.js/lib/scene/container/container-mixins/effectsMixin.d.ts:86
Whether the mask should be inverted. When true, the masked area becomes transparent and the unmasked area becomes visible.
Default
false
Example
// Invert the mask
sprite.setMask({
mask: graphics,
inverse: true
});