mwg API
    Preparing search index...

    Function rpgmAutotileFrame

    • Describes how RPG Maker MV composes one autotile from four 24px atlas quadrants.

      The returned geometry is renderer-neutral: a Pixi, canvas, or native renderer can draw each source rectangle into its destination rectangle without this module knowing about it. tileId is the output atlas index used by RPG Maker's 16-column generated atlas, while slot selects the source atlas family and shape indexes the caller's four-quadrant table.

      Parameters

      Returns RpgmAutotileFrame

      import { rpgmAutotileFrame } from '@datamoc/mw_games/two-d/render';

      const shapeTable = Array.from({ length: 48 }, () => [[0, 0], [1, 0], [0, 1], [1, 1]] as const);
      const frame = rpgmAutotileFrame(7, 0, 3, shapeTable);
      console.log(frame.quadrants[0].sourceX); // source pixel x coordinate