Map
A TMX map with access to its layers and tilesets. Access via the 'tilemap' submodule.
Constructor
-
Map() → Map
A TMX map with access to its layers and tilesets.
Properties
| Name | Description | Type |
|---|---|---|
all_layers | LayerList of layers in the map. | list[Layer] |
background_color | Map background color. | Color |
bounds | Map bounds in pixels. | Rect |
hex_side_length | Hex side length for hex maps. | float |
image_layers | List of image layers in the map. | list[ImageLayer] |
map_size | Map dimensions in tiles. | Vec2 |
object_groups | List of object group layers in the map. | list[ObjectGroup] |
orientation | Map orientation enum. | MapOrientation |
render_order | Tile render order enum. | MapRenderOrder |
stagger_axis | Stagger axis enum for staggered/hex maps. | MapStaggerAxis |
stagger_index | Stagger index enum for staggered/hex maps. | MapStaggerIndex |
tile_layers | List of tile layers in the map. | list[TileLayer] |
tile_sets | TileSetList of tilesets used by the map. | list[TileSet] |
tile_size | Size of tiles in pixels. | Vec2 |
Methods
Draw
draw() → NoneDraw all layers.
Get Layer
get_layer(name: str) → LayerGet a layer by its name. Will return None if not found.
Args
name: Name of the layer to retrieve.
Load
load(tmx_path: str) → NoneLoad a TMX file from path.
Args
tmx_path: Path to the TMX file to load.