LittleJS 1.28.0

TileLayers

TileLayerData

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

Constructor

new TileLayerData(tile, direction, mirror, color)engineTileLayer.js:625

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

tile number optional

The tile to use, from 0 like tile(); undefined is an empty cell that draws nothing

direction number optional, default 0

Integer direction of tile, in 90 degree increments

mirror boolean optional, default false

If the tile is flipped left to right

color Color optional

Color of the tile

// 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

Methods

Members

Color of the tile

direction : numberengineTileLayer.js:638

Integer direction of tile, in 90 degree increments

mirror : booleanengineTileLayer.js:640

If the tile is flipped left to right

tile : number|undefinedengineTileLayer.js:636

The tile to use, from 0 like tile(); undefined is an empty cell that draws nothing

Methods

Set this tile to clear, it will not be rendered