TileLayer

A single tile layer within a tile map.

Note:

TileLayer objects are not directly constructable. They are obtained from TileMap methods.

Properties


NameDescriptionType
typeThe type of the layer (OBJECT or TILE)TileLayer.Type
is_visibleWhether the layer is visiblebool
nameThe name of the layerstr
tilesA list of tiles in the layerlist[Tile]

Methods


Render

render() None

Render the tile layer to the screen.

Get From Area

get_from_area(area: Rect) list[Tile]

Get all tiles within a specified rectangular area.

Parameters

  • area : The rectangular area to check for tiles.

Returns

list[Tile] : A list of tiles within the specified area.

Get Tile At

get_tile_at(column: int, row: int) Tile | None

Get the tile at a specific column and row.

Parameters

  • column : The column index of the tile.
  • row : The row index of the tile.

Returns

Tile | None : The tile at the specified column and row, or None if it doesn't exist.