Class TMXTileMap

a TMX Tile Map Object Tiled QT +0.7.x format

Constructors

constructor

  • new TMXTileMap(levelId, data): TMXTileMap
  • Parameters

    • levelId: string

      name of TMX map

    • data: object

      TMX map in JSON format

    Returns TMXTileMap

    Example

    // create a new level object based on the TMX JSON object
    letlevel = newme.TMXTileMap(levelId, me.loader.getTMX(levelId));
    // add the level to the game world container
    level.addTo(me.game.world, true);

Properties

backgroundcolor

backgroundcolor: any

bounds

bounds: any

class

class: string

The map class.

cols

cols: number

width of the tilemap in tiles

height

height: any

hexsidelength

hexsidelength: number

infinite

infinite: number

is the map an infinite map

Default

0

initialized

initialized: boolean

isEditor

isEditor: boolean

layers

layers: any[]

name

name: string

name of the tilemap

nextobjectid

nextobjectid: undefined | number

objectGroups

objectGroups: any[]

orientation

orientation: string

the map orientation type. melonJS supports "orthogonal", "isometric", "staggered" and "hexagonal".

Default

"orthogonal"

renderer

renderorder

renderorder: string

the order in which tiles on orthogonal tile layers are rendered. (valid values are "left-down", "left-up", "right-down", "right-up")

Default

"right-down"

rows

rows: number

height of the tilemap in tiles

staggeraxis

staggeraxis: any

staggerindex

staggerindex: any

tiledversion

tiledversion: string

The Tiled version used to save the file (since Tiled 1.0.1).

tileheight

tileheight: number

Tile height

tilesets

tilesets: undefined | null | TMXTilesetGroup

tilewidth

tilewidth: number

Tile width

version

version: string

the TMX format version

width

width: any

Methods

addTo

  • addTo(container, flatten?, setViewportBounds?): void
  • add all the map layers and objects to the given container. note : this will not automatically update the camera viewport

    Parameters

    • container: Container

      target container

    • Optionalflatten: boolean

      if true, flatten all objects into the given container, else a me.Container object will be created for each corresponding groups

    • OptionalsetViewportBounds: boolean

      if true, set the viewport bounds to the map size, this should be set to true especially if adding a level to the game world container.

    Returns void

    Example

    // create a new level object based on the TMX JSON object
    letlevel = newme.TMXTileMap(levelId, me.loader.getTMX(levelId));
    // add the level to the game world container
    level.addTo(me.game.world, true, true);

destroy

getBounds

getLayers

getObjects

  • getObjects(flatten?): Renderable[]
  • return an Array of instantiated objects, based on the map object definition

    Parameters

    • Optionalflatten: boolean

      if true, flatten all objects into the returned array. when false, a me.Container object will be created for each corresponding groups

    Returns Renderable[]

    Array of Objects

getRenderer

Settings

Member Visibility

On This Page

AltStyle によって変換されたページ (->オリジナル) /