phaser - v3.90.0
    Preparing search index...

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

    Hierarchy (View Summary)

    Index

    Constructors

    • Parameters

      • gameObject: GameObject

        A reference to the Game Object that has this fx.

      • Optionalx: number

        The horizontal offset of the vignette effect. This value is normalized to the range 0 to 1. Default 0.5.

      • Optionaly: number

        The vertical offset of the vignette effect. This value is normalized to the range 0 to 1. Default 0.5.

      • Optionalradius: number

        The radius of the vignette effect. This value is normalized to the range 0 to 1. Default 0.5.

      • Optionalstrength: number

        The strength of the vignette effect. Default 0.5.

      Returns Vignette

    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.

    gameObject: GameObject

    A reference to the Game Object that owns this effect.

    radius: number

    The radius of the vignette effect. This value is normalized to the range 0 to 1.

    strength: number

    The strength of the vignette effect.

    type: number

    The FX_CONST type of this effect.

    x: number

    The horizontal offset of the vignette effect. This value is normalized to the range 0 to 1.

    y: number

    The vertical offset of the vignette effect. This value is normalized to the range 0 to 1.

    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