Introduction
TMX is the XML map format of the Tiled map editor, which can also save maps as
JSON. Files use the extension .tmx for the XML form and
.tmj for the JSON form. A map may refer to tilesets kept in separate
TSX files.
Structure
In XML the root element is map, which gives the orientation and the
sizes of the map and its tiles and holds tilesets, tile layers, object layers, image
layers and groups. Tile layer data may be written as CSV or as base64, the latter
optionally compressed with gzip, zlib or Zstandard. Each tile is given by a global
tile ID that can carry flip flags. The JSON form holds the same kind of data in a
map object with width, height, layers and
tilesets among its fields.
Not described
This page is a first outline.
Known, not yet covered
- Reference: the attributes of each element, the JSON fields, the flag bits of a tile ID and the changes between versions.
- Viewer: the site has no viewer for this format.
Also used for
- Translation Memory eXchange – XML exchange format for translation memories.
Links
Software
- Tiled – map editor that saves TMX and JSON maps
Reference
- TMX Map Format – Tiled’s reference for the XML form
- JSON Map Format – Tiled’s reference for the JSON form
- Support for TMX maps – Tiled’s list of libraries, in Debian’s copy of the source