melonJS
    Preparing search index...

    Interface MaskEffectOptions

    The settings of a MaskEffect, as its constructor takes them.

    interface MaskEffectOptions {
        center?: MaskCenter;
        color: string | Color;
        direction?: "hide" | "reveal";
        duration?: number;
        invert?: boolean;
        onComplete?: () => void;
        shape?: MaskShape;
    }
    Index
    center?: MaskCenter

    where the shape closes and opens: a renderable (where it is drawn when the effect starts) or a point in the camera's screen coordinates. The centre of the screen by default

    color: string | Color

    CSS color value or Color instance for the transition fill

    direction?: "hide" | "reveal"

    "hide" covers the scene (the default), "reveal" uncovers it

    duration?: number

    transition duration in milliseconds (500 by default)

    invert?: boolean

    make the shape the cover rather than the window: it grows out of center to hide the scene

    onComplete?: () => void

    callback when the transition finishes

    shape?: MaskShape

    an Ellipse or Polygon (unit-sized), an image or the name of a preloaded one, or a Sprite; an iris when omitted