Type Alias Tileset

Tileset: {
    image: HTMLImageElement | string;
    margin?: Vector2;
    spacing?: Vector2;
    tileHeight: number;
    tileWidth: number;
    width: number;
}

The Tileset configuration defines the properties of a tileset used by the TilemapRenderer.
It specifies the source image containing the tiles, the dimensions of the tileset and individual tiles,
and optional margin and spacing between tiles. This configuration is essential for properly
slicing and rendering tiles from the tileset image.

Type declaration

  • image: HTMLImageElement | string

    The tileset image element

  • Optionalmargin?: Vector2

    Margin of the tile in pixels (space in the top and the left)

  • Optionalspacing?: Vector2

    Spacing of the tile in pixels (space in the bottom and the right)

  • tileHeight: number
  • tileWidth: number
  • width: number