Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface for a Tiled map object.

Hierarchy

  • TiledMap

Index

Properties

levelIndex

levelIndex: number

Index of the level layer in tiles array.

mapHeight

mapHeight: number

Height of the map in tiles.

mapWidth

mapWidth: number

Width of the map in tiles.

tileHeight

tileHeight: number

Height of a tile in pixels.

tileWidth

tileWidth: number

Width of a tile in pixels.

tiles

tiles: TileData[][]

Array of arrays of tile objects.

Methods

getObjectByName

  • getObjectByName(name: string, mandatory?: boolean): Object
  • Gets an object from the map by name.

    Parameters

    • name: string

      Name of object to get.

    • Optional mandatory: boolean

      Whether a missing object is an error.

    Returns Object

getObjectsByType

  • getObjectsByType(type: string, mandatory?: boolean): Object[]
  • Gets an array of objects from the map by type.

    Parameters

    • type: string

      Type name of the objects to get.

    • Optional mandatory: boolean

      Whether no results is an error.

    Returns Object[]