The Pixelate FX Controller.
This FX controller manages the pixelate effect for a Game Object.
The pixelate effect is a visual technique that deliberately reduces the resolution or detail of an image, creating a blocky or mosaic appearance composed of large, visible pixels. This effect can be used for stylistic purposes, as a homage to retro gaming, or as a means to obscure certain elements within the game, such as during a transition or to censor specific content.
A Pixelate effect is added to a Game Object via the FX component:
const sprite = this.add.sprite();
sprite.preFX.addPixelate();
sprite.postFX.addPixelate();
new Pixelate(gameObject, [amount])
name | type | arguments | Default | description |
---|---|---|---|---|
gameObject | Phaser.GameObjects.GameObject |
A reference to the Game Object that has this fx. |
||
amount | number | <optional> | 1 |
The amount of pixelation to apply. |
Toggle this boolean to enable or disable this effect, without removing and adding it from the Game Object.
Only works for Pre FX.
Post FX are always active.
The amount of pixelation to apply.
A reference to the Game Object that owns this effect.
The FX_CONST type of this effect.
Destroys this FX Controller.
Sets the active state of this FX Controller.
A disabled FX Controller will not be updated.
name | type | description |
---|---|---|
value | boolean |
|
This FX Controller instance.