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


NameDescriptionType
all_layersLayerList of layers in the map.list[Layer]
background_colorMap background color.Color
boundsMap bounds in pixels.Rect
hex_side_lengthHex side length for hex maps.float
image_layersList of image layers in the map.list[ImageLayer]
map_sizeMap dimensions in tiles.Vec2
object_groupsList of object group layers in the map.list[ObjectGroup]
orientationMap orientation enum.MapOrientation
render_orderTile render order enum.MapRenderOrder
stagger_axisStagger axis enum for staggered/hex maps.MapStaggerAxis
stagger_indexStagger index enum for staggered/hex maps.MapStaggerIndex
tile_layersList of tile layers in the map.list[TileLayer]
tile_setsTileSetList of tilesets used by the map.list[TileSet]
tile_sizeSize of tiles in pixels.Vec2

Methods


Draw

draw() None

Draw all layers.

Get Layer

get_layer(name: str) Layer

Get a layer by its name. Will return None if not found.

Args

  • name : Name of the layer to retrieve.

Load

load(tmx_path: str) None

Load a TMX file from path.

Args

  • tmx_path : Path to the TMX file to load.