The Barrel FX Controller.
This FX controller manages the barrel distortion effect for a Game Object.
A barrel effect allows you to apply either a 'pinch' or 'expand' distortion to a Game Object. The amount of the effect can be modified in real-time.
A Barrel effect is added to a Game Object via the FX component:
const sprite = this.add.sprite();
sprite.preFX.addBarrel();
sprite.postFX.addBarrel();
new Barrel(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 distortion applied to the barrel effect. A value of 1 is no distortion. Typically keep this within +- 1. |
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 distortion applied to the barrel effect.
Typically keep this within the range 1 (no distortion) to +- 1.
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.