mwg API
    Preparing search index...

    Interface TileMapOptions

    interface TileMapOptions {
        chunkSize?: number;
        height: number;
        heightStep?: number;
        shape?: "square" | "hex" | "isometric" | "staggered";
        sheet: SpriteSheet | readonly SpriteSheet[];
        tileHeight?: number;
        tileWidth?: number;
        width: number;
    }
    Index
    chunkSize?: number

    Tiles per chunk, per side.

    The map is cut into square chunks so that culling can switch off a whole block at once instead of testing every tile. 16 keeps chunks small enough to cull tightly and large enough that there are not many of them.

    height: number
    heightStep?: number

    Pixels of lift per elevation level; defaults to half a tile, the classic isometric block proportion. A cell raised to height h draws its top h steps higher, with side faces filling the bands between.

    shape?: "square" | "hex" | "isometric" | "staggered"

    How a cell's grid position becomes a pixel position.

    'hex' is the one that also changes which cells are neighbours - it is the same shape a Level can be given, and the two must agree for a hex map to make sense. 'isometric' and 'staggered' are pixel-only: the grid underneath is still an ordinary square one (four or eight neighbours, whatever a game's Level already is), this only changes where each cell draws - which is the whole difference between them and hex, and why Level has no equivalent option for either.

    sheet: SpriteSheet | readonly SpriteSheet[]

    The sheet tiles are drawn from, or one per tileset when a map mixes several. Cells then hold tileFrame packs rather than plain indices - see tileFrame. The first sheet sets the default tile size.

    tileHeight?: number
    tileWidth?: number

    in world units; defaults to the sheet's frame size, which is the usual case

    width: number

    in tiles