TileLayer

TileLayer represents a grid of tiles within the map. Access via the 'tilemap' submodule.

Inherits from Layer.

Properties


NameDescriptionType
opacityLayer opacity from 0.0 to 1.0.float
tilesTileLayerTileList of tiles in the layer grid.TileLayer.TileLayerTileList

Methods


Get From Area

get_from_area(area: Rect) 'std::vector<kn::tilemap::TileLayer::TileResult,std::allocator<kn::tilemap::TileLayer::TileResult> >'

Return tiles intersecting a Rect area.

Args

  • area : World-space area to query.

Returns

list[TileLayer.TileResult] : List of TileResult entries for tiles intersecting the area.

Get From Point

get_from_point(position: Vec2) object

Return the tile at a given world position.

Args

  • position : World-space position to query.

Returns

Optional[TileLayer.TileResult] : TileResult entry if a tile exists at the position, None otherwise.

Draw

draw() None

Draw the tile layer.