Skip to main content

GlowEffect

Outer glow wrapped in a convenient object with live-tunable settings, the ergonomic counterpart to createGlowPasses.

const glow = new ex.GlowEffect({ graphicsContext, color: ex.Color.Cyan, strength: 3 });
actor.graphics.material = new ex.Material({ graphicsContext, passes: glow, padding: 16 });

glow.intensity = 2;            // animate any time, applies next frame
glow.color = ex.Color.Magenta;

Implements

Index

Constructors

Properties

Accessors

Methods

Constructors

constructor

Properties

publicreadonlyscale

scale: number

Resolution the glow blur runs at relative to the source, fixed at construction

Accessors

publiccolor

  • Glow color. Assign a new color to change it, mutating the color instance in place will not be picked up.


    Returns Color

  • Parameters

    Returns void

publicintensity

  • get intensity(): number
  • set intensity(value: number): void
  • Multiplies the halo's opacity.

    The halo saturates at full opacity, so 0-1 is the useful range for fading a glow in and out; values above 1 make the core denser and hotter before saturating.


    Returns number

  • Parameters

    • value: number

    Returns void

publicstrength

  • get strength(): number
  • set strength(value: number): void
  • Blur radius multiplier in texels of the (downsampled) glow resolution


    Returns number

  • Parameters

    • value: number

    Returns void

Methods

publicdispose

  • dispose(): void
  • Returns void

publicprocess