Members
height
The number of rows in the Tile Map
- Source:
layers
Array of layer data
- Source:
name
The name of the Tile Map
- Source:
width
The number of columns in the Tile Map
- Source:
Methods
_getTypedArrayFromDataLayer(dataLayer)
Convert an array of numbers into a Uint16Array
Parameters:
Name | Type | Description |
---|---|---|
dataLayer |
Array.<number> |
- Source:
getLayerData(layer, startX, startY, endX, endY)
get an array of the layer data, optionally only getting a subsection of the layer
Parameters:
Name | Type | Default | Description |
---|---|---|---|
layer |
number | 0 | The layer |
startX |
number | 0 | The bottom left x position |
startY |
number | 0 | The bottom left y position |
endX |
number | 0 | The top right x position |
endY |
number | 0 | The top right y position |
- Source:
getTile(x, y, layer)
Get the tile GID at a given position
Parameters:
Name | Type | Default | Description |
---|---|---|---|
x |
number | The x position | |
y |
number | The y position | |
layer |
number | 0 | The index of the layer on the tile map you are checking |
- Source:
setTile(gid, x, y, layer)
Set the tile GID at a given position
Parameters:
Name | Type | Default | Description |
---|---|---|---|
gid |
* | The gid | |
x |
* | The x position | |
y |
* | The y position | |
layer |
* | 0 | The index of the layer on the tile map you are setting |
- Source: