mwg API
    Preparing search index...

    Function rpgmAutotileSlot

    • Which MV autotile family a raw map tile id belongs to, or null when the id is not an autotile at all (an EMPTY cell, a static B-E tile, an A5 tile).

      Parameters

      • tile: number

      Returns RpgmAutotileSlot | null

      import {
      rpgmAutotileSlot,
      RPGM_AUTOTILE_SLOT_BASES,
      RPGM_AUTOTILE_SLOT_COUNTS,
      } from '@datamoc/mwg/two-d/render';

      console.log(rpgmAutotileSlot(2048)); // 0 - the first A1 tile
      console.log(rpgmAutotileSlot(3000)); // 1 - inside the A2 range
      console.log(rpgmAutotileSlot(42)); // null - a static tile, not an autotile
      console.log(rpgmAutotileSlot(-1)); // null - EMPTY reads as blank, never as a slot
      console.log(RPGM_AUTOTILE_SLOT_BASES[0]); // 2048 - where slot 0 starts
      console.log(RPGM_AUTOTILE_SLOT_COUNTS[0]); // 768 - 16 kinds times 48 shapes