-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
JSON Map Format
Ryan Roden-Corrent edited this page Apr 28, 2015
·
11 revisions
Tiled can also export maps as JSON files. To do so, simply select "File > Export As" and select the JSON file type. You can export json from the command line with the "--export-map" option.
The fields found in the JSON format differ slightly from those in the TMX Map Format, but the should meanings remain the same.
The following fields can be found in a Tiled JSON file:
| Field | Type | Description |
|---|---|---|
| width | int | Number of tile columns |
| height | int | Number of tile rows |
| tilewidth | int | Map grid width. |
| tileheight | int | Map grid height. |
| orientation | string | Orthogonal, isometric, or staggered |
| layers | array | Array of Layers |
| tilesets | array | Array of Tilesets |
| backgroundcolor | string | Hex-formatted color (#RRGGBB) (Optional) |
| renderorder | string | Rendering direction (orthogonal maps only) |
| properties | object | String key-value pairs |
| nextobjectid | int | Auto-increments for each placed object |
| Field | Type | Description |
|---|---|---|
| width | int | Column count. Same as map width in Tiled Qt. |
| height | int | Row count. Same as map height in Tiled Qt. |
| name | string | Name assigned to this layer |
| type | string | "tilelayer", "objectgroup", or "imagelayer" |
| visible | bool | Whether layer is shown or hidden in editor |
| x | int | Horizontal layer offset. Always 0 in Tiled Qt. |
| y | int | Vertical layer offset. Always 0 in Tiled Qt. |
| data | int | Array of GIDs. tilelayer only. |
| objects | object | Array of Objects. objectgroup only. |
| properties | object | string key-value pairs. |
| opacity | float | Value between 0 and 1 |
| draworder | string | ??? |
| Field | Type | Description |
|---|---|---|
| id | int | Incremental id - unique across all objects |
| width | int | Width in pixels. Ignored if using a gid. |
| height | int | Height in pixels. Ignored if using a gid. |
| name | string | String assigned to name field in editor |
| type | string | String assigned to type field in editor |
| properties | object | String key-value pairs |
| visible | bool | Whether object is shown in editor. |
| x | int | x coordinate in pixels |
| y | int | y coordinate in pixels |
| rotation | float | Angle in degrees clockwise |
| gid | int | GID, only if object comes from a Tilemap |
| Field | Type | Description |
|---|---|---|
| firstgid | int | GID corresponding to the first tile in the set |
| image | string | Image used for tiles in this set |
| name | string | Name given to this tileset |
| tilewidth | int | Maximum width of tiles in this set |
| tileheight | int | Maximum height of tiles in this set |
| imagewidth | int | Width of source image in pixels |
| imageheight | int | Height of source image in pixels |
| properties | object | String key-value pairs |
| margin | int | Buffer between image edge and first tile (pixels) |
| spacing | int | Spacing between adjacent tiles in image (pixels) |
| tileproperties | object | Per-tile properties, indexed by gid as string |
Quick Links: Download on itch.io • Tiled Manual • Support Tiled Development