melonJS
    Preparing search index...

    Class TintPulseEffect

    A shader effect that pulses a color overlay on the sprite. Commonly used for status effects — poison green, freeze blue, fire red. The time uniform should be updated each frame for the pulse animation.

    Renderable.shader for usage

    // poison pulse
    const poison = new TintPulseEffect(renderer, {
    color: [0.0, 1.0, 0.0],
    speed: 3.0,
    });
    mySprite.shader = poison;

    // update each frame
    poison.setTime(timer.getTime() / 1000);

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    _enabledBeforeSuspend: boolean | undefined
    destroyed: boolean = false

    true once destroy has been called. Distinct from enabled — which also toggles transiently across a context lost / restored cycle — to give callers a stable signal for "this effect has been explicitly released."

    enabled: boolean = false

    whether this effect is active (false in Canvas mode, false after destroy, and false while the WebGL context is suspended between an ONCONTEXT_LOST and the matching ONCONTEXT_RESTORED event).

    Methods