TileGrid
A grid of columns by rows cells, each holding a Tile of tileSet, read through get. Column 0 is the left edge and row 0 the top, so cell (column, row) covers the area from column * tileSet.tileWidth, row * tileSet.tileHeight across one tile, in the grid's own units, and y points down as in the rest of the world.
Both kinds of tile layer are grids: a TileMapLayer, read from a map file and never changed, and a TileLayer, the component that draws and that a game may change. tileAt, solidRectangles, toTileLayer and Commands.spawnSolids work on either.
Has no sample because a TileSet needs a texture, which needs a GPU device.
Inheritors
Functions
Returns rectangles that together cover exactly the cells whose tile isSolid, in the grid's own units, with (0, 0) at the grid's top-left corner, as few as this simple merge finds: each row's runs of neighboring solid cells become one rectangle, and runs that cover the same columns in the rows below grow it downwards. The rectangles are sorted from the top row down and left to right, and never overlap.
Returns the tile under the point (x, y), given in the grid's own units, with (0, 0) at the grid's top-left corner, or Tile.EMPTY when the point is outside the grid. For a TileLayer on an entity at (layerX, layerY) with scale 1, pass the world position minus the entity's, as in layer.tileAt(x - layerX, y - layerY).
Returns a new TileLayer holding a copy of this grid's cells and its TileGrid.tileSet, which a game may change and add to an entity to draw. The copy is independent: changing one does not change the other. Its sprite layer, color and visibility are TileLayer's defaults; Commands.spawnTileLayer copies a map layer's visibility and opacity too.