While there are many libraries and frameworks that work directly with Tiled maps, Tiled also supports a number of additional file and export formats.
Exporting can be done by clicking File > Export. When triggering the
menu action multiple times, Tiled will only ask for the file name the
first time. Exporting can also be automated using the
Several Export Options are available, which are applied to maps or tilesets before they are exported (without affecting the map or tileset itself).
When exporting on the command-line on Linux, Tiled will still need an X server to run. To automate exports in a headless environment, you can use a headless X server such as Xvfb. In this case you would run Tiled from the command-line as follows:
xvfb-run tiled --export-map ...
The JSON format is currently the only additional format supported for tilesets.
Maps and tilesets can be exported to Lua code. This export option supports most of Tiled’s features and is useful when using a Lua-based framework like LÖVE (with Simple Tiled Implementation), Corona (with ponytiled or Dusk Engine) or Defold.
Currently not included are the type of custom properties (though the type does affect how a property value is exported) and information related to recent features like Wang tiles and object templates.
The CSV export only supports tile layers.
Maps containing multiple tile layers will export as multiple files,
Each tile is written out by its ID, unless the tile has a custom
name, in which case its value is used to write out
the tile. Using multiple tilesets will lead to ambiguous IDs, unless the
name property is used. Empty cells get the value
GameMaker: Studio 1.4¶
GameMaker: Studio 1.4 uses a custom XML-based format to store its rooms, and Tiled ships with a plugin to export maps in this format. Currently only orthogonal maps will export correctly.
Tile layers and tile objects (when no type is set) will export as “tile” elements. These support horizontal and vertical flipping, but no rotation. For tile objects, scaling is also supported.
The tilesets have to be named the same as the corresponding backgrounds
in the GameMaker project. Otherwise GameMaker will pop up an error for each
tile while loading the exported
GameMaker object instances are created by putting the object name in the “Type” field of the object in Tiled. Rotation is supported here, and for tile objects also flipping and scaling is supported (though flipping in combination with rotation doesn’t appear to work in GameMaker).
The following custom properties can be set on objects to affect the exported instance:
code(instance creation code, default: “”)
scaleX(default: derived from tile or 1.0)
scaleY(default: derived from tile or 1.0)
scaleY properties can be used to override the
scale of the instance. However, if the scale is relevant then it will
generally be easier to use a tile object, in which case it is
automatically derived from the tile size and the object size.
originY properties can be used to tell Tiled
about the origin of the object defined in GameMaker, as an offset from
the top-left. This origin is taken into account when determining the
position of the exported instance.
Of course setting the type and/or the above properties manually for each instance will get old fast. Since Tiled 1.0.2, you can instead use tile objects with the type set on the tile, and in Tiled 1.1 you can also use object templates.
Views can be defined using rectangle objects
where the Type has been set to
view. The position and size will be
snapped to pixels. Whether the view is visible when the room starts
depends on whether the object is visible. The use of views is
automatically enabled when any views are defined.
The following custom properties can be used to define the various other properties of the view:
Port on screen
code(map creation code, default: “”)
PhysicsWorldRight(default: width of map in pixels)
PhysicsWorldBottom(default: height of map in pixels)
Both tile layers and object layers may produce “tile” elements in the exported room file. Their depth is set automatically, with tiles from the bottom-most layer getting a value of 10000000 (the GameMaker default) and counting up from there. If you want to set a custom depth value you can set the following property on the layer:
depth(default: 10000000 + N)
Tiled ships with a plugin that enables direct editing of Stardew Valley maps (and any other maps using the tBIN format). This plugin needs to be enabled in Edit > Preferences > Plugins. It is not enabled by default because it won’t store everything (most notably it doesn’t support object layers in general, nor external tilesets), so you need to know what you are doing.
The tBIN format supports setting custom properties on the tiles of a tile layer. Since Tiled does not support this directly, “TileData” objects are created that match the location of the tile, on which such properties are then stored.
Tiled can export to Defold using one of the two supplied plugins. Both are disabled by default.
This plugin exports a map to a Defold Tile Map (*.tilemap). It only supports tile layers and only a single tileset may be used.
Upon export, the
tile_set property of the Tile Map is left empty, so it will need to be set up in Defold after each export.
This plugin exports a map to a Defold Collection (*.collection), while also creating multiple .tilemap files.
- Group layers (only top-level group layers are supported, not nested ones!)
- Multiple Tilesets per Tilemap
Pathproperty of each Tileset may need to be set up manually in Defold after each export. However, Tiled will attempt to find the .tilesource file corresponding with the name your Tileset in Tiled in your project’s
/tilesources/directory. If one is found, manual adjustments won’t be necessary.
- If you create custom properties on your map called
y-offset, these values will be used as coordinates for your top-level GameObject in the Collection. This is useful when working with Worlds.
All layers of a Tilemap will have Z-index property assigned with values ranging between 0 and 0.1. The plugin supports the use of 9999 Group Layers and 9999 Tile Layers per Group Layer.
When any additional information from the map is needed, the map can be exported in Lua format and loaded as Defold script.
A few other plugins ship with Tiled to support various games:
- Adds support for editing DroidCraft maps (*.dat)
- Adds support for editing Flare Engine maps (*.txt)
- Adds support for editing Replica Island maps (*.bin)
- Adds support for exporting to T-Engine4 maps (*.lua)
These plugins are disabled by default. They can be enabled in Edit > Preferences > Plugins.