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

    Methods

    Constructors

    Properties

    enabled: boolean = false

    whether this effect is active (false in Canvas mode)

    Methods