Options
All
  • Public
  • Public/Protected
  • All
Menu

Class TMXMapInfo

cc.TMXMapInfo contains the information about the map like:
- Map orientation (hexagonal, isometric or orthogonal)
- Tile size
- Map size

And it also contains:
- Layers (an array of TMXLayerInfo objects)
- Tilesets (an array of TMXTilesetInfo objects)
- ObjectGroups (an array of TMXObjectGroupInfo objects)

This information is obtained from the TMX file.

Hierarchy

  • TMXMapInfo

Index

Constructors

constructor

  • newTMXMapInfo(tmxFile: string, tsxContentMap: {}, spfTexturesMap: {}, textureSizes: {}, imageLayerTextures: {}): TMXMapInfo

Properties

Protected _allChildren

Protected _hexSideLength

_hexSideLength: number = 0

Protected imageLayerSPF

imageLayerSPF: {} | null = null

Protected _imageLayers

_imageLayers: TMXImageLayerInfo[] = []

Protected _layers

_layers: TMXLayerInfo[] = []

Protected _mapSize

_mapSize: Size = new Size(0, 0)

Protected _objectGroups

_objectGroups: TMXObjectGroupInfo[] = []

Protected spfSizeMap

spfSizeMap: {}

Type declaration

  • [key: string]: Size

Protected spriteFrameMap

spriteFrameMap: {} | null = null

Protected _staggerAxis

_staggerAxis: StaggerAxis | null = null

Protected _staggerIndex

_staggerIndex: StaggerIndex | null = null

Protected _supportVersion

_supportVersion: number[] = [1, 4, 0]

Protected _tileAnimations

_tileAnimations: TiledAnimationType = {} as any

Protected _tileProperties

_tileProperties: Map<GID, PropertiesInfo> = new Map()

Protected _tileSize

_tileSize: Size = new Size(0, 0)

Protected _tilesets

_tilesets: TMXTilesetInfo[] = []

Protected tsxContentMap

tsxContentMap: {} | null = null

currentString

currentString: string | null = null

Current string stored from characters stream.

property

{String} currentString

layerAttrs

layerAttrs: number = 0

Layer attributes.

property

{Object} layerAttrs

orientation

orientation: Orientation | null = null

Map orientation.

property

{Number} orientation

parentElement

parentElement: Object | null = null

Parent element.

property

{Object} parentElement

parentGID

parentGID: MixedGID = 0 as unknown as any

Parent GID.

property

{Number} parentGID

properties

properties: PropertiesInfo = {} as any

Properties of the map info.

property

{Array} properties

renderOrder

renderOrder: RenderOrder = RenderOrder.RightDown

storingCharacters

storingCharacters: boolean = false

Is reading storing characters stream.

property

{Boolean} storingCharacters

Accessors

mapHeight

  • get mapHeight(): number
  • set mapHeight(height: number): void

mapSize

  • get mapSize(): Size

mapWidth

  • get mapWidth(): number
  • set mapWidth(width: number): void

tileHeight

  • get tileHeight(): number
  • set tileHeight(height: number): void

tileSize

  • get tileSize(): Size

tileWidth

  • get tileWidth(): number
  • set tileWidth(width: number): void

Methods

Protected parseImageLayer

Protected parseLayer

Protected parseObjectGroup

Protected parsePointsString

  • parsePointsString(pointsString?: undefined | string): null | { x: number; y: number }[]

Protected shouldIgnoreNode

  • shouldIgnoreNode(node: ChildNode): boolean

getAllChildren

getCurrentString

  • getCurrentString(): null | string

getHexSideLength

  • getHexSideLength(): number

getImageLayers

getLayerAttribs

  • getLayerAttribs(): number

getLayers

getMapSize

  • getMapSize(): Size

getObjectGroups

getOrientation

getParentElement

  • getParentElement(): null | Object

getParentGID

  • getParentGID(): number

getProperties

  • getProperties(): {}

getStaggerAxis

getStaggerIndex

getStoringCharacters

  • getStoringCharacters(): boolean

getTileAnimations

getTileProperties

  • getTileProperties(): Map<number, {}>

getTileSize

  • getTileSize(): Size

getTilesets

initWithXML

  • initWithXML(tmxString: string, tsxMap: {}, spfTextureMap: {}, textureSizes: {}, imageLayerTextures: {}): HTMLElement
  • initializes a TMX format with an XML string and a TMX resource path

    Parameters

    • tmxString: string
    • tsxMap: {}
      • [key: string]: string
    • spfTextureMap: {}
    • textureSizes: {}
      • [key: string]: Size
    • imageLayerTextures: {}

    Returns HTMLElement

parseXMLString

  • parseXMLString(xmlStr: string, tilesetFirstGid?: undefined | number): HTMLElement
  • Initializes parsing of an XML string, either a tmx (Map) string or tsx (Tileset) string

    Parameters

    • xmlStr: string
    • Optional tilesetFirstGid: undefined | number

    Returns HTMLElement

setCurrentString

  • setCurrentString(currentString: string): void

setHexSideLength

  • setHexSideLength(value: number): void

setImageLayers

setLayerAttribs

  • setLayerAttribs(value: any): void

setLayers

setMapSize

  • setMapSize(value: Size): void

setObjectGroups

setOrientation

setParentElement

  • setParentElement(value: any): void

setParentGID

  • setParentGID(value: any): void

setProperties

  • setProperties(value: any): void

setStaggerAxis

setStaggerIndex

  • setStaggerIndex(value: any): void

setStoringCharacters

  • setStoringCharacters(value: any): void

setTileAnimations

setTileProperties

setTileSize

  • setTileSize(value: Size): void

setTilesets

Static getShortName

  • getShortName(name: string): string

Generated using TypeDoc