Phaser API Documentation

  Version: 
<static> PutTileAt(tile, tileX, tileY, recalculateFaces, layer)

Description:

Puts a tile at the given tile coordinates in the specified layer. You can pass in either an index or a Tile object. If you pass in a Tile, all attributes will be copied over to the specified location. If you pass in an index, only the index at the specified location will be changed. Collision information will be recalculated at the specified location.

Parameters:

name type description
tile number | Phaser.Tilemaps.Tile

The index of this tile to set or a Tile object.

tileX number

The x coordinate, in tiles, not pixels.

tileY number

The y coordinate, in tiles, not pixels.

recalculateFaces boolean

true if the faces data should be recalculated.

layer Phaser.Tilemaps.LayerData

The Tilemap Layer to act upon.

Returns:
Description:

The Tile object that was created or added to this map.

Since: 3.0.0