phaser - v3.90.0
    Preparing search index...

    The Glow FX Controller.

    This FX controller manages the glow effect for a Game Object.

    The glow effect is a visual technique that creates a soft, luminous halo around game objects, characters, or UI elements. This effect is used to emphasize importance, enhance visual appeal, or convey a sense of energy, magic, or otherworldly presence. The effect can also be set on the inside of the Game Object. The color and strength of the glow can be modified.

    A Glow effect is added to a Game Object via the FX component:

    const sprite = this.add.sprite();

    sprite.preFX.addGlow();
    sprite.postFX.addGlow();

    Hierarchy (View Summary)

    Index

    Constructors

    • Parameters

      • gameObject: GameObject

        A reference to the Game Object that has this fx.

      • Optionalcolor: number

        The color of the glow effect as a number value. Default 0xffffff.

      • OptionalouterStrength: number

        The strength of the glow outward from the edge of the Sprite. Default 4.

      • OptionalinnerStrength: number

        The strength of the glow inward from the edge of the Sprite. Default 0.

      • Optionalknockout: boolean

        If true only the glow is drawn, not the texture itself. Default false.

      Returns Glow

    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.

    color: number

    The color of the glow as a number value.

    gameObject: GameObject

    A reference to the Game Object that owns this effect.

    glcolor: number[]

    A 4 element array of gl color values.

    innerStrength: number

    The strength of the glow inward from the edge of the Sprite.

    knockout: number

    If true only the glow is drawn, not the texture itself.

    outerStrength: number

    The strength of the glow outward from the edge of the Sprite.

    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