phaser - v3.90.0
    Preparing search index...

    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();

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    Methods

    Constructors

    • Parameters

      • gameObject: GameObject

        A reference to the Game Object that has this fx.

      • Optionalamount: number

        The amount of distortion applied to the barrel effect. A value of 1 is no distortion. Typically keep this within +- 1. Default 1.

      Returns Barrel

    Properties

    active: boolean

    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.

    amount: number

    The amount of distortion applied to the barrel effect.

    Typically keep this within the range 1 (no distortion) to +- 1.

    gameObject: GameObject

    A reference to the Game Object that owns this effect.

    type: number

    The FX_CONST type of this effect.

    Methods

    • Destroys this FX Controller.

      Returns void

    • Sets the active state of this FX Controller.

      A disabled FX Controller will not be updated.

      Parameters

      • value: boolean

        true to enable this FX Controller, or false to disable it.

      Returns this