Constructor
new TileLayerData(tileopt, directionopt, mirroropt, coloropt)
Create a tile layer data object, one for each tile in a TileLayer
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
tile | Number | <optional> | The tile to use, untextured if undefined | |
direction | Number | <optional> | 0 | Integer direction of tile, in 90 degree increments |
mirror | Boolean | <optional> | false | If the tile should be mirrored along the x axis |
color | Color | <optional> | Color of the tile |
- Source
Example
// create tile layer data with tile index 0 and random orientation and color
const tileIndex = 0;
const direction = randInt(4)
const mirror = randInt(2);
const color = randColor();
const data = new TileLayerData(tileIndex, direction, mirror, color);
Members
color
PropertiesType | Description |
---|---|
Color | Color of the tile |
- Source
direction
PropertiesType | Description |
---|---|
Number | Integer direction of tile, in 90 degree increments |
- Source
mirror
PropertiesType | Description |
---|---|
Boolean | If the tile should be mirrored along the x axis |
- Source
tile
PropertiesType | Description |
---|---|
Number | The tile to use, untextured if undefined |
- Source
Methods
clear()
Set this tile to clear, it will not be rendered
- Source