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

    enabled: boolean = false

    whether this effect is active (false in Canvas mode)

    size: number

    Methods