new BackgroundMap(tilesize, data, tileset)
Parameters:
| Name | Type | Description |
|---|---|---|
tilesize |
Number | Size of a single tile(in pixel) |
data |
Array | Map ata |
tileset |
Texture | Tileset texture |
- Source:
Members
-
<readonly> height
-
Height of this map (in tile)
- Source:
-
<readonly> width
-
Width of this map (in tile)
- Source:
Methods
-
getTile(r, q)
-
Get the tile with its row and column
Parameters:
Name Type Description rNumber Row
qNumber Column
- Source:
Returns:
Tile index
- Type
- Number
-
getTileAt(x, y)
-
Get the tile at a specific position
Parameters:
Name Type Description xNumber X position
yNumber Y position
- Source:
Returns:
Tile index
- Type
- Number
-
setTile(r, q, tile)
-
Set the tile at (row, column)
Parameters:
Name Type Description rNumber Row
qNumber Column
tileNumber Tile index to set
- Source:
-
setTileAt(x, y, tile)
-
Set the tile at a specific position
Parameters:
Name Type Description xNumber X position
yNumber Y position
tileNumber Tile index
- Source: