TiledMap class

Below is Tiled's documentation about how this structure is represented on XML files:

Constructors

TiledMap({TileMapType type = TileMapType.map, String version = '1.0', String? tiledVersion, required int width, required int height, bool infinite = false, required int tileWidth, required int tileHeight, List<Tileset> tilesets = const [], List<Layer> layers = const [], String? backgroundColorHex, Color? backgroundColor, int compressionLevel = -1, int? hexSideLength, int? nextLayerId, int? nextObjectId, MapOrientation? orientation, RenderOrder renderOrder = RenderOrder.rightDown, StaggerAxis? staggerAxis, StaggerIndex? staggerIndex, List<EditorSetting> editorSettings = const [], CustomProperties properties = CustomProperties.empty})
TiledMap.parse(Parser parser, {List<TsxProvider>? tsxList})
factory

Properties

backgroundColor Color?
Color to be rendered as a solid color behind all other layers (optional).
getter/setter pair
backgroundColorHex String?
Hex-formatted color (#RRGGBB or #AARRGGBB) to be rendered as a solid color behind all other layers (optional).
getter/setter pair
compressionLevel int
getter/setter pair
editorSettings List<EditorSetting>
getter/setter pair
hashCode int
The hash code for this object.
no setterinherited
height int
getter/setter pair
hexSideLength int?
getter/setter pair
infinite bool
getter/setter pair
layers List<Layer>
getter/setter pair
nextLayerId int?
getter/setter pair
nextObjectId int?
getter/setter pair
orientation MapOrientation?
getter/setter pair
properties CustomProperties
getter/setter pair
renderOrder RenderOrder
getter/setter pair
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
staggerAxis StaggerAxis?
getter/setter pair
staggerIndex StaggerIndex?
getter/setter pair
tiledVersion String?
getter/setter pair
tileHeight int
getter/setter pair
tilesets List<Tileset>
getter/setter pair
tileWidth int
getter/setter pair
type TileMapType
getter/setter pair
version String
getter/setter pair
width int
getter/setter pair

Methods

layerByName(String name) Layer
Finds the first layer with the matching name, or throw an ArgumentError if one cannot be found. Will search recursively through Group children.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
tileByGid(int tileGid) Tile?
tileByLocalId(String tileSetName, int localId) Tile?
tileByPhrase(String tilePhrase) Tile?
tiledImages() List<TiledImage>
tilesetByName(String name) Tileset
tilesetByTileGId(int tileGId) Tileset
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Methods

fromString(String contents, Future<TsxProvider> tsxProviderFunction(String key)) Future<TiledMap>
Takes a string contents and converts it to a TiledMap with the help of the TsxProviders returned from the tsxProviderFunction. The tsxProviderFunction is most commonly your static TsxProvider.parse implementation.