mwg API
    Preparing search index...

    Function xpAutotileRef

    • Decodes a raw XP map cell into its autotile image and pattern, or null when the cell holds no autotile reference: EMPTY, a static tileset tile (384 and up), or anything outside the 1-383 autotile range.

      Parameters

      • tile: number

      Returns XpAutotileRef | null

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

      console.log(xpAutotileRef(97)); // { index: 2, pattern: 1 } - second image, second pattern
      console.log(xpAutotileRef(0)); // null - EMPTY is blank, never an autotile
      console.log(xpAutotileRef(384)); // null - the first static tileset tile