melonJS
    Preparing search index...

    Class DesaturateEffect

    A shader effect that desaturates (grayscales) the sprite. Commonly used for disabled states, death effects, or petrification.

    Renderable.shader for usage

    // full grayscale
    mySprite.shader = new DesaturateEffect(renderer);
    // partial desaturation (50%)
    mySprite.shader = new DesaturateEffect(renderer, { intensity: 0.5 });

    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).

    intensity: number

    Methods