Class: Tilemap

Tilemap()

new Tilemap()

The tilemap which displays 2D tile-based game map.
Properties:
Name Type Description
TILE_ID_B Number [static]
TILE_ID_C Number [static]
TILE_ID_D Number [static]
TILE_ID_E Number [static]
TILE_ID_A5 Number [static]
TILE_ID_A1 Number [static]
TILE_ID_A2 Number [static]
TILE_ID_A3 Number [static]
TILE_ID_A4 Number [static]
TILE_ID_MAX Number [static]
FLOOR_AUTOTILE_TABLE Array.<Array.<Array.<Number>>> [static]
WALL_AUTOTILE_TABLE Array.<Array.<Array.<Number>>> [static]
WATERFALL_AUTOTILE_TABLE Array.<Array.<Array.<Number>>> [static]
parent Object [read-only][super] The object that contains the tilemap.
children Array [read-only][super] The array of children of the sprite.
animationCount Number The animation count for autotiles.
bitmaps Array The bitmaps used as a tileset.
origin Point The origin point of the tilemap for scrolling.
flags Array The tileset flags.
tileHeight Number The height of a tile in pixels.
tileWidth Number The width of a tile in pixels.
height Number The height of the screen in pixels.
width Number The width of the screen in pixels.
horizontalWrap Boolean Whether the tilemap loops horizontal.
verticalWrap Boolean Whether the tilemap loops vertical.

Extends

  • PIXI.Container

Methods

(static) getAutotileKind(tileId) → {Number}

Parameters:
Name Type Description
tileId Number
Returns:
Type
Number

(static) getAutotileShape(tileId) → {Number}

Parameters:
Name Type Description
tileId Number
Returns:
Type
Number

(static) isAutotile(tileId) → {Boolean}

Parameters:
Name Type Description
tileId Number
Returns:
Type
Boolean

(static) isFloorTypeAutotile(tileId) → {Boolean}

Parameters:
Name Type Description
tileId Number
Returns:
Type
Boolean

(static) isGroundTile(tileId) → {Boolean}

Parameters:
Name Type Description
tileId Number
Returns:
Type
Boolean

(static) isRoofTile(tileId) → {Boolean}

Parameters:
Name Type Description
tileId Number
Returns:
Type
Boolean

(static) isSameKindTile(tileID1, tileID2) → {Boolean}

Parameters:
Name Type Description
tileID1 Number
tileID2 Number
Returns:
Type
Boolean

(static) isShadowingTile(tileId) → {Boolean}

Parameters:
Name Type Description
tileId Number
Returns:
Type
Boolean

(static) isTileA1(tileId) → {Boolean}

Parameters:
Name Type Description
tileId Number
Returns:
Type
Boolean

(static) isTileA2(tileId) → {Boolean}

Parameters:
Name Type Description
tileId Number
Returns:
Type
Boolean

(static) isTileA4(tileId) → {Boolean}

Parameters:
Name Type Description
tileId Number
Returns:
Type
Boolean

(static) isTileA5(tileId) → {Boolean}

Parameters:
Name Type Description
tileId Number
Returns:
Type
Boolean

(static) isVisibleTile(tileId) → {Boolean}

Parameters:
Name Type Description
tileId Number
Returns:
Type
Boolean

(static) isWallTile(tileId) → {Boolean}

Parameters:
Name Type Description
tileId Number
Returns:
Type
Boolean

(static) isWallTopTile(tileId) → {Boolean}

Parameters:
Name Type Description
tileId Number
Returns:
Type
Boolean

(static) isWallTypeAutotile(tileId) → {Boolean}

Parameters:
Name Type Description
tileId Number
Returns:
Type
Boolean

(static) isWaterfallTile(tileId) → {Boolean}

Parameters:
Name Type Description
tileId Number
Returns:
Type
Boolean

(static) isWaterfallTypeAutotile(tileId) → {Boolean}

Parameters:
Name Type Description
tileId Number
Returns:
Type
Boolean

(static) isWaterTile(tileId) → {Boolean}

Parameters:
Name Type Description
tileId Number
Returns:
Type
Boolean

(static) makeAutotileId(tileId, shape) → {Number}

Parameters:
Name Type Description
tileId Number
shape Number
Returns:
Type
Number

addChild(child) → {Object}

[super] Adds a child to the container.
Parameters:
Name Type Description
child Object The child to add
Returns:
The child that was added
Type
Object

addChildAt(child, index) → {Object}

[super] Adds a child to the container at a specified index.
Parameters:
Name Type Description
child Object The child to add
index Number The index to place the child in
Returns:
The child that was added
Type
Object

initialize()

isReady() → {Boolean}

Checks whether the tileset is ready to render.
Returns:
True if the tilemap is ready
Type
Boolean

refresh()

Forces to repaint the entire tilemap.

refreshTileset()

Forces to refresh the tileset

removeChild(child) → {Object}

[super] Removes a child to the container.
Parameters:
Name Type Description
child Object The child to remove
Returns:
The child that was removed
Type
Object

removeChildAt(index) → {Object}

[super] Removes a child from the specified index position.
Parameters:
Name Type Description
index Number The index to get the child from
Returns:
The child that was removed
Type
Object

setData(width, height, data)

Sets the tilemap data.
Parameters:
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.