mwg API
    Preparing search index...

    Interface AutomapTarget

    The slice of a tile map automapping reads and writes, named rather than imported.

    Automapping is a grid transform: it matches patterns of tile indices and writes tile indices back. Naming render.TileMap for that pulled a whole 2D renderer into mwg/rpg for two method signatures, which is why this is an interface instead - a real TileMap satisfies it structurally, and so does any other grid a game keeps its own way.

    interface AutomapTarget {
        heightInTiles: number;
        shape?: "square" | "hex" | "isometric" | "staggered";
        widthInTiles: number;
        getTile(layer: string | number, x: number, y: number): number;
        setTile(layer: string | number, x: number, y: number, value: number): void;
    }
    Index
    heightInTiles: number
    shape?: "square" | "hex" | "isometric" | "staggered"

    optional topology, used to reject a rule authored for the other map shape

    widthInTiles: number
    • Parameters

      • layer: string | number
      • x: number
      • y: number

      Returns number

    • Parameters

      • layer: string | number
      • x: number
      • y: number
      • value: number

      Returns void