melonJS
    Preparing search index...

    Class ChromaticAberrationEffect

    A shader effect that offsets the RGB color channels to create a chromatic aberration (color fringe) effect. Commonly used for impact feedback, glitch effects, or damage indicators.

    Renderable.shader for usage

    // subtle chromatic aberration
    mySprite.shader = new ChromaticAberrationEffect(renderer, { offset: 2.0 });
    // strong glitch effect
    mySprite.shader = new ChromaticAberrationEffect(renderer, { offset: 5.0 });

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

    offset: number

    Methods