mwg API
    Preparing search index...

    Class LiquidLayer

    An animated liquid surface under a tile map: one scrolling tiling quad per liquid cell, so each cell can carry its own visibility tint (setCellColor, the same idea as TileMap.setCellColor) without showing liquid in cells the player has not seen. ripple spawns a ring that grows and fades on a cell. Drive it with update(dt) each frame.

    Every child opts out of pointer events: a decorative layer must never swallow the taps meant for the map beneath it.

    import { Texture } from 'pixi.js';
    import { LiquidLayer } from '@datamoc/mwg/two-d/render';

    const water = new LiquidLayer({
    texture: Texture.EMPTY,
    width: 8,
    height: 8,
    isLiquid: (x, y) => y > 5,
    });
    water.setCellColor(3, 6, 0xffffff); // lit; a tint of 0 hides the cell
    water.update(1 / 60);

    Hierarchy

    • Container
      • LiquidLayer
    Index
    • tints one cell; a tint of 0 hides it, and cells start hidden until lit

      Parameters

      • x: number
      • y: number
      • tint: number

      Returns void