TileLayer
A single tile layer within a tile map.
Note:
TileLayer objects are not directly constructable. They are obtained from TileMap methods.
Properties
| Name | Description | Type |
|---|---|---|
type | The type of the layer (OBJECT or TILE) | TileLayer.Type |
is_visible | Whether the layer is visible | bool |
name | The name of the layer | str |
tiles | A list of tiles in the layer | list[Tile] |
Methods
Render
render() → NoneRender 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 | NoneGet 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.