melonJS
    Preparing search index...

    Class DissolveEffect

    A shader effect that dissolves the sprite using a noise-based threshold. Pixels are discarded based on a pseudo-random noise pattern as the progress value increases from 0 to 1. Commonly used for death, spawn, or teleport effects.

    Renderable.shader for usage

    // create a dissolve effect
    const dissolve = new DissolveEffect(renderer);
    mySprite.shader = dissolve;

    // animate the dissolve (0 = fully visible, 1 = fully dissolved)
    dissolve.setProgress(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).

    progress: number

    Methods