Class: Tilemap

Tilemap

new Tilemap ()

The tilemap which displays 2D tile-based game map.

Extends

  • PIXI.Container

Members

animationCount number

The animation count for autotiles.

flags array

The tileset flags.

height number

The height of the tilemap.

horizontalWrap boolean

Whether the tilemap loops horizontal.

origin Point

The origin point of the tilemap for scrolling.

tileHeight number

The height of each tile.

tileWidth number

The width of each tile.

verticalWrap boolean

Whether the tilemap loops vertical.

width number

The width of the tilemap.

Methods

destroy ()

Destroys the tilemap.

isReady ()boolean

Checks whether the tileset is ready to render.

Returns:
Type Description
boolean True if the tilemap is ready.

refresh ()

Forces to repaint the entire tilemap.

setBitmaps (bitmaps)

Sets the bitmaps used as a tileset.

Name Type Description
bitmaps array

The array of the tileset bitmaps.

setData (width, height, data)

Sets the tilemap data.

Name Type Description
width number

The width of the map in number of tiles.

height number

The height of the map in number of tiles.

data array

The one dimensional array for the map data.

update ()

Updates the tilemap for each frame.

updateTransform ()

Updates the transform on all children of this container for rendering.