A TMX map with access to its layers and tilesets. Access via the 'tilemap' submodule.
A TMX map with access to its layers and tilesets.
| Name | Description | Type |
|---|---|---|
background_color | Map background color. | Color |
orientation | Map orientation enum. | MapOrientation |
render_order | Tile render order enum. | MapRenderOrder |
map_size | Map dimensions in tiles. | Vec2 |
tile_size | Size of tiles in pixels. | Vec2 |
bounds | Map bounds in pixels. | Rect |
hex_side_length | Hex side length for hex maps. | float |
stagger_axis | Stagger axis enum for staggered/hex maps. | MapStaggerAxis |
stagger_index | Stagger index enum for staggered/hex maps. | MapStaggerIndex |
tile_sets | TileSetList of tilesets used by the map. | TileSetList |
all_layers | LayerList of layers in the map. | LayerList |
tile_layers | List of tile layers in the map. | list[TileLayer] |
object_groups | List of object group layers in the map. | list[ObjectGroup] |
image_layers | List of image layers in the map. | list[ImageLayer] |
load(tmx_path: str | PathLike[str]) → Noneload(tmx_path: str | PathLike[str]) → NoneLoad a TMX file from path.
Args
tmx_path : Path to the TMX file to load.draw(angle: float = 0.0, pivot: Vec2 = ...) → Nonedraw(angle: float = 0.0, pivot: Vec2 = ...) → NoneDraw all layers.
Args
angle : Rotation angle in degrees to apply to the entire map. Defaults to 0.0.pivot : Pivot point for rotation, as normalized coordinates relative to the map size. Defaults to (0.5, 0.5).