Kraken Logo

Kraken Engine

DocumentationGuidesShowcaseCommunity
Ctrl
K
Navigating the Docs
Building Docs
Overview
Anchor
AnimationController
Audio
Batcher
Body
Camera
Capsule
CastHit
CharacterBody
Circle
Collision
Color
DistanceJoint
Effect
Event
FilterJoint
Flip (Texture)
Font
ImageLayer
InputAction
Joint
Layer
Line
Map
MapObject
Mask
MotorJoint
MouseJoint
ObjectGroup
Orchestrator
PixelArray
PolarCoordinate
Polygon
PrismaticJoint
Rect
RevoluteJoint
RigidBody
Sample
Sampler
Shader
SheetStrip
StaticBody
Stream
Style
Terrain (TileSet)
Text
TextProperties
Texture
Tile (TileLayer)
Tile (TileSet)
TileLayer
TileResult (TileLayer)
TileSet
Timer
Transform
Tween
Vec2
Vertex
WeldJoint
WheelJoint
World

Built bydurkisneer1.Kraken Engine is open source and available onGitHub.

  1. Docs
  2. Classes
  3. Map

Map

A TMX map with access to its layers and tilesets. Access via the 'tilemap' submodule.

Constructor

  • Map(tmx_path: str | PathLike = '') → MapMap(tmx_path: str | PathLike = '') → 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.list[TileLayer]
object_groupsList of object group layers in the map.list[ObjectGroup]
image_layersList of image layers in the map.list[ImageLayer]

Methods


Load

load(tmx_path: str | PathLike[str]) → Noneload(tmx_path: str | PathLike[str]) → None

Load a TMX file from path.

Args

  • tmx_path : Path to the TMX file to load.

Draw

draw(angle: float = 0.0, pivot: Vec2 = ...) → Nonedraw(angle: float = 0.0, pivot: Vec2 = ...) → None

Draw 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).

Get Layer

get_layer(name: str) → Layerget_layer(name: str) → Layer

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

Args

  • name : Name of the layer to retrieve.
PreviousLine
NextMapObject

On this page

ConstructorPropertiesMethodsLoadDrawGet Layer