mwg API
    Preparing search index...

    Function rpgmTableEdgeCells

    • The cells that get a table's front-edge strip, in the engine's own rule (Tilemap._paintTiles): a cell whose layer-1 neighbour above is an A2 table tile, while its own layer-1 tile is not a table, and whose layer-0 tile is not an A3/A4 wall. Each such cell holds the table tile above it (a raw MV id), every other cell 0, ready for an addAutotileLayer set with tableEdge: true.

      Parameters

      Returns Int32Array

      import { rpgmTableEdgeCells } from '@datamoc/mwg/two-d/render';

      const table = 2816 + 48 * 0 + 47; // an A2 kind with the table flag
      const flags = { [table]: 0x80 };
      const cells = rpgmTableEdgeCells({ width: 1, height: 2, ground: [0, 0], objects: [table, 0], flags });
      console.log(cells[1]); // the table tile above cell 1
      console.log(cells[0]); // 0 - nothing above the top row