melonJS
    Preparing search index...

    Class PixelateEffect

    A shader effect that pixelates the sprite by snapping UV coordinates to a grid. Commonly used for teleport effects, transitions, or retro styling.

    Renderable.shader for usage

    // moderate pixelation
    mySprite.shader = new PixelateEffect(renderer, { size: 8.0 });
    // animate the pixelation (e.g. for teleport)
    pixelate.setSize(pixelate.size + dt / 50);

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

    size: number

    Methods