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
background_colorMap background color.Color
orientationMap orientation enum.MapOrientation
render_orderTile render order enum.MapRenderOrder
map_sizeMap dimensions in tiles.Vec2
tile_sizeSize of tiles in pixels.Vec2
boundsMap bounds in pixels.Rect
hex_side_lengthHex side length for hex maps.float
stagger_axisStagger axis enum for staggered/hex maps.MapStaggerAxis
stagger_indexStagger index enum for staggered/hex maps.MapStaggerIndex
tile_setsTileSetList of tilesets used by the map.TileSetList
all_layersLayerList of layers in the map.LayerList
tile_layersList of tile layers in the map.'std::vector<std::shared_ptr<kn::tilemap::TileLayer>,std::allocator<std::shared_ptr<kn::tilemap::TileLayer> > >'
object_groupsList of object group layers in the map.'std::vector<std::shared_ptr<kn::tilemap::ObjectGroup>,std::allocator<std::shared_ptr<kn::tilemap::ObjectGroup> > >'
image_layersList of image layers in the map.'std::vector<std::shared_ptr<kn::tilemap::ImageLayer>,std::allocator<std::shared_ptr<kn::tilemap::ImageLayer> > >'

Methods


Load

load(tmx_path: str) None

Load a TMX file from path.

Args

  • tmx_path : Path to the TMX file to load.

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.