The Vignette FX Controller.
This FX controller manages the vignette effect for a Game Object.
The vignette effect is a visual technique where the edges of the screen, or a Game Object, gradually darken or blur, creating a frame-like appearance. This effect is used to draw the player's focus towards the central action or subject, enhance immersion, and provide a cinematic or artistic quality to the game's visuals.
A Vignette effect is added to a Game Object via the FX component:
const sprite = this.add.sprite();
sprite.preFX.addVignette();
sprite.postFX.addVignette();
new Vignette(gameObject, [x], [y], [radius], [strength])
name | type | arguments | Default | description |
---|---|---|---|---|
gameObject | Phaser.GameObjects.GameObject |
A reference to the Game Object that has this fx. |
||
x | number | <optional> | 0.5 |
The horizontal offset of the vignette effect. This value is normalized to the range 0 to 1. |
y | number | <optional> | 0.5 |
The vertical offset of the vignette effect. This value is normalized to the range 0 to 1. |
radius | number | <optional> | 0.5 |
The radius of the vignette effect. This value is normalized to the range 0 to 1. |
strength | number | <optional> | 0.5 |
The strength of the vignette effect. |
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.
A reference to the Game Object that owns this effect.
The radius of the vignette effect. This value is normalized to the range 0 to 1.
The strength of the vignette effect.
The FX_CONST type of this effect.
The horizontal offset of the vignette effect. This value is normalized to the range 0 to 1.
The vertical offset of the vignette effect. This value is normalized to the range 0 to 1.
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.