TileLayerData

Tile layer data object stores info about how to render a tile

Constructor

new TileLayerData(tileopt, directionopt, mirroropt, coloropt)

Create a tile layer data object, one for each tile in a TileLayer

Parameters:
NameTypeAttributesDefaultDescription
tileNumber<optional>

The tile to use, untextured if undefined

directionNumber<optional>
0

Integer direction of tile, in 90 degree increments

mirrorBoolean<optional>
false

If the tile should be mirrored along the x axis

colorColor<optional>

Color of the tile

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

Properties
TypeDescription
Color

Color of the tile

direction

Properties
TypeDescription
Number

Integer direction of tile, in 90 degree increments

mirror

Properties
TypeDescription
Boolean

If the tile should be mirrored along the x axis

tile

Properties
TypeDescription
Number

The tile to use, untextured if undefined

Methods

clear()

Set this tile to clear, it will not be rendered