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, from 0 like tile(); undefined is an empty cell that draws nothing | |
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 = randBool();
const color = randColor();
const data = new TileLayerData(tileIndex, direction, mirror, color);Members
color
Properties| Type | Description |
|---|---|
| Color | Color of the tile |
- Source
direction
Properties| Type | Description |
|---|---|
| number | Integer direction of tile, in 90 degree increments |
- Source
mirror
Properties| Type | Description |
|---|---|
| boolean | If the tile should be mirrored along the x axis |
- Source
tile :number|undefined
Type:
Properties- number |
undefined
| Type | Description |
|---|---|
| number | | The tile to use, from 0 like tile(); undefined is an empty cell that draws nothing |
- Source
Methods
clear()
Set this tile to clear, it will not be rendered
- Source