JSON-Kartenformat
Tiled kann Karten als JSON-Dateien exportiern. Wählen Sie dazu einfach „Datei > Exportieren unter“ und wählen Sie den JSON-Dateityp. Sie können Json von der Kommandozeile mit der Option --export-map
exportieren.
Die Felder im JSON-Format unterscheiden sich geringfügig von denen im TMX Map Format, aber die Bedeutungen sollten dieselben sein.
Die folgenden Felder können in der Tiled JSON Datei gefunden werden:
Karte
Feld |
Typ |
Beschreibung |
---|---|---|
Hintergrundfarbe |
Zeichenkette |
Hex-formatierte Farbe (#RRGGBB or #AARRGGBB) (optional) |
class |
Zeichenkette |
The class of the map (since 1.9, optional) |
Komprimierungsgrad |
Ganzzahl (int) |
Die Kompressionsstufe für Daten der Kachelebene (Standard: -1, bedeutet, die Voreinstellung des Algorithmus wird verwendet) |
Höhe |
Ganzzahl (int) |
Anzahl der Kachelreihen |
hexsidelength |
Ganzzahl (int) |
Länge einer sechseckigen Kachel in Pixeln (nur für hexagonale Karten gültig( |
unendlich |
Boolean (wahr/falsch) |
Ob die Karte unendliche Dimensionen hat |
Ebenen |
Array |
Array von Ebenen |
nextlayerid |
Ganzzahl (int) |
Erhöht sich automatisch für jede Ebene |
nextobjectid |
Ganzzahl (int) |
Erhöht sich automatisch für jedes platzierte Objekt |
Ausrichtung |
Zeichenkette |
|
parallaxoriginx |
double |
X coordinate of the parallax origin in pixels (since 1.8, default: 0) |
parallaxoriginy |
double |
Y coordinate of the parallax origin in pixels (since 1.8, default: 0) |
Eigenschaften |
Array |
Array von Eigenschaften |
Zeichenreihenfolge |
Zeichenkette |
|
staggeraxis |
Zeichenkette |
|
staggerindex |
Zeichenkette |
|
tiledversion |
Zeichenkette |
Die Tiled Version, mit der die Datei gespeichert wurde |
Tile-Höhe |
Ganzzahl (int) |
Kartenrasterhöhe |
Tilesets |
Array |
Array von Kachelsätzen |
Tile-Breite |
Ganzzahl (int) |
Kartenrasterbreite |
Typ |
Zeichenkette |
|
Version |
Zeichenkette |
Das JSON-Format (früher eine Zahl, seit 1.6 eine Zeichenkette) |
Breite |
Ganzzahl (int) |
Anzahl der Kachelspalten |
Beispielkarte
{
"backgroundcolor":"#656667",
"height":4,
"layers":[ ],
"nextobjectid":1,
"orientation":"orthogonal",
"properties":[
{
"name":"mapProperty1",
"type":"string",
"value":"one"
},
{
"name":"mapProperty2",
"type":"string",
"value":"two"
}],
"renderorder":"right-down",
"tileheight":32,
"tilesets":[ ],
"tilewidth":32,
"version":1,
"tiledversion":"1.0.3",
"width":4
}
Ebene
Feld |
Typ |
Beschreibung |
---|---|---|
chunks |
Array |
Array of chunks (optional). |
class |
Zeichenkette |
The class of the layer (since 1.9, optional) |
Komprimierung |
Zeichenkette |
|
Daten |
Feld oder Zeichenkette |
Array of |
Zeichenreihenfolge |
Zeichenkette |
|
Kodierung |
Zeichenkette |
|
Höhe |
Ganzzahl (int) |
Row count. Same as map height for fixed-size maps. |
ID |
Ganzzahl (int) |
Incremental ID - unique across all layers |
Bild |
Zeichenkette |
Image used by this layer. |
Ebenen |
Array |
Array of layers. |
locked |
Boolean (wahr/falsch) |
Whether layer is locked in the editor (default: false). (since Tiled 1.8.2) |
Name |
Zeichenkette |
Name der dieser Ebene zugeordnet ist |
Objekte |
Array |
Array von Objekten. nur |
offsetx |
double |
Horizontal layer offset in pixels (default: 0) |
offsety |
double |
Vertical layer offset in pixels (default: 0) |
Deckkraft |
double |
Wert zwischen 0 und 1 |
parallaxx |
double |
Horizontal parallax factor for this layer (default: 1). (since Tiled 1.5) |
parallaxy |
double |
Vertical parallax factor for this layer (default: 1). (since Tiled 1.5) |
Eigenschaften |
Array |
Array von Eigenschaften |
repeatx |
Boolean (wahr/falsch) |
Whether the image drawn by this layer is repeated along the X axis. |
repeaty |
Boolean (wahr/falsch) |
Whether the image drawn by this layer is repeated along the Y axis. |
startx |
Ganzzahl (int) |
X coordinate where layer content starts (for infinite maps) |
starty |
Ganzzahl (int) |
Y coordinate where layer content starts (for infinite maps) |
tintcolor |
Zeichenkette |
Hex-formatted tint color (#RRGGBB or #AARRGGBB) that is multiplied with any graphics drawn by this layer or any child layers (optional). |
transparentcolor |
Zeichenkette |
Hex-formatierte Farbe (#RRGGBB or #AARRGGBB) (optional). Nur für |
Typ |
Zeichenkette |
|
Sichtbar |
Boolean (wahr/falsch) |
Ob die Ebene im Editor sichtbar oder versteckt ist |
Breite |
Ganzzahl (int) |
Column count. Same as map width for fixed-size maps. |
x |
Ganzzahl (int) |
Horizontal layer offset in tiles. Always 0. |
y |
Ganzzahl (int) |
Vertical layer offset in tiles. Always 0. |
Beispiel für Kachelebene
The data of a tile layer can be stored as a native JSON array or as base64-encoded and optionally compressed binary data, the same as done in the TMX format. The tiles are referenced using Global Tile IDs.
{
"data":[1, 2, 1, 2, 3, 1, 3, 1, 2, 2, 3, 3, 4, 4, 4, 1],
"height":4,
"name":"ground",
"opacity":1,
"properties":[
{
"name":"tileLayerProp",
"type":"int",
"value":1
}],
"type":"tilelayer",
"visible":true,
"width":4,
"x":0,
"y":0
}
Object Layer Example
{
"draworder":"topdown",
"height":0,
"name":"people",
"objects":[ ],
"opacity":1,
"properties":[
{
"name":"layerProp1",
"type":"string",
"value":"someStringValue"
}],
"type":"objectgroup",
"visible":true,
"width":0,
"x":0,
"y":0
}
Chunk
Chunks are used to store the tile layer data for infinite maps.
Feld |
Typ |
Beschreibung |
---|---|---|
Daten |
Feld oder Zeichenkette |
Array of |
Höhe |
Ganzzahl (int) |
Height in tiles |
Breite |
Ganzzahl (int) |
Width in tiles |
x |
Ganzzahl (int) |
X coordinate in tiles |
y |
Ganzzahl (int) |
Y coordinate in tiles |
Beispielkarte
{
"data":[1, 2, 1, 2, 3, 1, 3, 1, 2, 2, 3, 3, 4, 4, 4, 1, ],
"height":16,
"width":16,
"x":0,
"y":-16,
}
Objekt
Feld |
Typ |
Beschreibung |
---|---|---|
Ellipse |
Boolean (wahr/falsch) |
Markiert ein Objekt als Ellipse |
gid |
Ganzzahl (int) |
Global tile ID, only if object represents a tile |
Höhe |
double |
Height in pixels. |
ID |
Ganzzahl (int) |
Incremental ID, unique across all objects |
Name |
Zeichenkette |
String assigned to name field in editor |
Punkt |
Boolean (wahr/falsch) |
Markiert ein Objekt als Punkt |
Polygon |
Array |
Array of Points, in case the object is a polygon |
polyline |
Array |
Array of Points, in case the object is a polyline |
Eigenschaften |
Array |
Array von Eigenschaften |
Rotation |
double |
Angle in degrees clockwise |
template |
Zeichenkette |
Reference to a template file, in case object is a template instance |
text |
Only used for text objects |
|
Typ |
Zeichenkette |
The class of the object (was saved as |
Sichtbar |
Boolean (wahr/falsch) |
Whether object is shown in editor. |
Breite |
double |
Width in pixels. |
x |
double |
X coordinate in pixels |
y |
double |
Y coordinate in pixels |
Object Example
{
"gid":5,
"height":0,
"id":1,
"name":"villager",
"properties":[
{
"name":"hp",
"type":"int",
"value":12
}],
"rotation":0,
"type":"npc",
"visible":true,
"width":0,
"x":32,
"y":32
}
Ellipse Example
{
"ellipse":true,
"height":152,
"id":13,
"name":"",
"rotation":0,
"type":"",
"visible":true,
"width":248,
"x":560,
"y":808
}
Rectangle Example
{
"height":184,
"id":14,
"name":"",
"rotation":0,
"type":"",
"visible":true,
"width":368,
"x":576,
"y":584
}
Point Example
{
"height":0,
"id":20,
"name":"",
"point":true,
"rotation":0,
"type":"",
"visible":true,
"width":0,
"x":220,
"y":350
}
Polygon Example
{
"height":0,
"id":15,
"name":"",
"polygon":[
{
"x":0,
"y":0
},
{
"x":152,
"y":88
},
{
"x":136,
"y":-128
},
{
"x":80,
"y":-280
},
{
"x":16,
"y":-288
}],
"rotation":0,
"type":"",
"visible":true,
"width":0,
"x":-176,
"y":432
}
Polyline Example
{
"height":0,
"id":16,
"name":"",
"polyline":[
{
"x":0,
"y":0
},
{
"x":248,
"y":-32
},
{
"x":376,
"y":72
},
{
"x":544,
"y":288
},
{
"x":656,
"y":120
},
{
"x":512,
"y":0
}],
"rotation":0,
"type":"",
"visible":true,
"width":0,
"x":240,
"y":88
}
Text Example
{
"height":19,
"id":15,
"name":"",
"text":
{
"text":"Hello World",
"wrap":true
},
"rotation":0,
"type":"",
"visible":true,
"width":248,
"x":48,
"y":136
}
Text
Feld |
Typ |
Beschreibung |
---|---|---|
bold |
Boolean (wahr/falsch) |
Whether to use a bold font (default: |
color |
Zeichenkette |
Hex-formatierte Farbe (#RRGGBB or #AARRGGBB) (Standard: |
fontfamily |
Zeichenkette |
Font family (default: |
halign |
Zeichenkette |
Horizontal alignment ( |
italic |
Boolean (wahr/falsch) |
Whether to use an italic font (default: |
kerning |
Boolean (wahr/falsch) |
Whether to use kerning when placing characters (default: |
pixelsize |
Ganzzahl (int) |
Pixel size of font (default: 16) |
strikeout |
Boolean (wahr/falsch) |
Whether to strike out the text (default: |
text |
Zeichenkette |
Text |
underline |
Boolean (wahr/falsch) |
Whether to underline the text (default: |
valign |
Zeichenkette |
Vertical alignment ( |
wrap |
Boolean (wahr/falsch) |
Whether the text is wrapped within the object bounds (default: |
Tileset
Feld |
Typ |
Beschreibung |
---|---|---|
Hintergrundfarbe |
Zeichenkette |
Hex-formatierte Farbe (#RRGGBB or #AARRGGBB) (optional) |
class |
Zeichenkette |
The class of the tileset (since 1.9, optional) |
columns |
Ganzzahl (int) |
The number of tile columns in the tileset |
fillmode |
Zeichenkette |
The fill mode to use when rendering tiles from this tileset ( |
firstgid |
Ganzzahl (int) |
GID corresponding to the first tile in the set |
grid |
(optional) |
|
Bild |
Zeichenkette |
Image used for tiles in this set |
imageheight |
Ganzzahl (int) |
Height of source image in pixels |
imagewidth |
Ganzzahl (int) |
Width of source image in pixels |
margin |
Ganzzahl (int) |
Buffer between image edge and first tile (pixels) |
Name |
Zeichenkette |
Name given to this tileset |
objectalignment |
Zeichenkette |
Alignment to use for tile objects ( |
Eigenschaften |
Array |
Array von Eigenschaften |
source |
Zeichenkette |
The external file that contains this tilesets data |
spacing |
Ganzzahl (int) |
Spacing between adjacent tiles in image (pixels) |
terrains |
Array |
Array of Terrains (optional) |
tilecount |
Ganzzahl (int) |
The number of tiles in this tileset |
tiledversion |
Zeichenkette |
Die Tiled Version, mit der die Datei gespeichert wurde |
Tile-Höhe |
Ganzzahl (int) |
Maximum height of tiles in this set |
tileoffset |
(optional) |
|
tilerendersize |
Zeichenkette |
The size to use when rendering tiles from this tileset on a tile layer ( |
tiles |
Array |
Array of Tiles (optional) |
Tile-Breite |
Ganzzahl (int) |
Maximum width of tiles in this set |
transformations |
Allowed transformations (optional) |
|
transparentcolor |
Zeichenkette |
Hex-formatierte Farbe (#RRGGBB or #AARRGGBB) (optional) |
Typ |
Zeichenkette |
|
Version |
Zeichenkette |
Das JSON-Format (früher eine Zahl, seit 1.6 eine Zeichenkette) |
wangsets |
Array |
Array of Wang sets (since 1.1.5) |
Each tileset has a firstgid
(first global ID) property which
tells you the global ID of its first tile (the one with local
tile ID 0). This allows you to map the global IDs back to the
right tileset, and then calculate the local tile ID by
subtracting the firstgid
from the global tile ID. The first
tileset always has a firstgid
value of 1.
Grid
Specifies common grid settings used for tiles in a tileset. See <grid> in the TMX Map Format.
Feld |
Typ |
Beschreibung |
---|---|---|
Höhe |
Ganzzahl (int) |
Cell height of tile grid |
Ausrichtung |
Zeichenkette |
|
Breite |
Ganzzahl (int) |
Cell width of tile grid |
Tile Offset
See <tileoffset> in the TMX Map Format.
Feld |
Typ |
Beschreibung |
---|---|---|
x |
Ganzzahl (int) |
Horizontal offset in pixels |
y |
Ganzzahl (int) |
Vertical offset in pixels (positive is down) |
Transformations
See <transformations> in the TMX Map Format.
Feld |
Typ |
Beschreibung |
---|---|---|
hflip |
Boolean (wahr/falsch) |
Tiles can be flipped horizontally |
vflip |
Boolean (wahr/falsch) |
Tiles can be flipped vertically |
rotate |
Boolean (wahr/falsch) |
Tiles can be rotated in 90-degree increments |
preferuntransformed |
Boolean (wahr/falsch) |
Whether untransformed tiles remain preferred, otherwise transformed tiles are used to produce more variations |
Tileset Example
{
"columns":19,
"firstgid":1,
"image":"..\/image\/fishbaddie_parts.png",
"imageheight":480,
"imagewidth":640,
"margin":3,
"name":"",
"properties":[
{
"name":"myProperty1",
"type":"string",
"value":"myProperty1_value"
}],
"spacing":1,
"tilecount":266,
"tileheight":32,
"tilewidth":32
}
Tile (Definition)
Feld |
Typ |
Beschreibung |
---|---|---|
Animation |
Array |
Array of Frames |
ID |
Ganzzahl (int) |
Local ID of the tile |
Bild |
Zeichenkette |
Image representing this tile (optional, used for image collection tilesets) |
imageheight |
Ganzzahl (int) |
Height of the tile image in pixels |
imagewidth |
Ganzzahl (int) |
Width of the tile image in pixels |
x |
Ganzzahl (int) |
The X position of the sub-rectangle representing this tile (default: 0) |
y |
Ganzzahl (int) |
The Y position of the sub-rectangle representing this tile (default: 0) |
Breite |
Ganzzahl (int) |
The width of the sub-rectangle representing this tile (defaults to the image width) |
Höhe |
Ganzzahl (int) |
The height of the sub-rectangle representing this tile (defaults to the image height) |
Objektgruppe |
Layer with type |
|
probability |
double |
Percentage chance this tile is chosen when competing with others in the editor (optional) |
Eigenschaften |
Array |
Array von Eigenschaften |
terrain |
Array |
Index of terrain for each corner of tile (optional, replaced by Wang sets since 1.5) |
Typ |
Zeichenkette |
The class of the tile (was saved as |
A tileset that associates information with each tile, like its image
path, may include a tiles
array property. Each tile
has an id
property, which specifies the local ID within the tileset.
For the terrain information, each value is a length-4 array where each element is the index of a terrain on one corner of the tile. The order of indices is: top-left, top-right, bottom-left, bottom-right.
Example:
{
"id":11,
"properties":[
{
"name":"myProperty2",
"type":"string",
"value":"myProperty2_value"
}],
"terrain":[0, 1, 0, 1]
}
Frame
Feld |
Typ |
Beschreibung |
---|---|---|
Dauer |
Ganzzahl (int) |
Frame duration in milliseconds |
Kachel-ID |
Ganzzahl (int) |
Local tile ID representing this frame |
Terrain
Feld |
Typ |
Beschreibung |
---|---|---|
Name |
Zeichenkette |
Name of terrain |
Eigenschaften |
Array |
Array von Eigenschaften |
tile |
Ganzzahl (int) |
Local ID of tile representing terrain |
Example:
{
"name":"ground",
"tile":0
}
Wang Set
Feld |
Typ |
Beschreibung |
---|---|---|
class |
Zeichenkette |
The class of the Wang set (since 1.9, optional) |
colors |
Array |
Array of Wang colors (since 1.5) |
Name |
Zeichenkette |
Name of the Wang set |
Eigenschaften |
Array |
Array von Eigenschaften |
tile |
Ganzzahl (int) |
Local ID of tile representing the Wang set |
Typ |
Zeichenkette |
|
wangtiles |
Array |
Array of Wang tiles |
Wang Color
Feld |
Typ |
Beschreibung |
---|---|---|
class |
Zeichenkette |
The class of the Wang color (since 1.9, optional) |
color |
Zeichenkette |
Hex-formatierte Farbe (#RRGGBB or #AARRGGBB) |
Name |
Zeichenkette |
Name of the Wang color |
probability |
double |
Probability used when randomizing |
Eigenschaften |
Array |
Array of Properties (since 1.5) |
tile |
Ganzzahl (int) |
Local ID of tile representing the Wang color |
Example:
{
"color": "#d31313",
"name": "Rails",
"probability": 1,
"tile": 18
}
Wang Tile
Feld |
Typ |
Beschreibung |
---|---|---|
Kachel-ID |
Ganzzahl (int) |
Local ID of tile |
wangid |
Array |
Array of Wang color indexes ( |
Example:
{
"tileid": 0,
"wangid": [2, 0, 1, 0, 1, 0, 2, 0]
}
Objektvorlage
Eine Objektvorlage wird in einer eigenen Datei gespeichert von allen Instanzen dieser Vorlage referenziert.
Feld |
Typ |
Beschreibung |
---|---|---|
Typ |
Zeichenkette |
|
Tileset |
Externes, von der Vorlage verwendetes Tileset (optional) |
|
Objekt |
Das auf Grundlage dieser Vorlage erzeugte Objekt |
Eigenschaft
Feld |
Typ |
Beschreibung |
---|---|---|
Name |
Zeichenkette |
Name der Eigenschaft |
Typ |
Zeichenkette |
Type of the property ( |
propertytype |
Zeichenkette |
Name of the custom property type, when applicable (since 1.8) |
value |
value |
Wert der Eigenschaft |
Punkt
A point on a polygon or a polyline, relative to the position of the object.
Feld |
Typ |
Beschreibung |
---|---|---|
x |
double |
X coordinate in pixels |
y |
double |
Y coordinate in pixels |
Changelog
Tiled 1.10
Renamed the
class
property on Tile (Definition) and Objekt back totype
, to keep compatibility with Tiled 1.8 and earlier. The property remainsclass
in other places since it could not be renamed totype
everywhere.
Tiled 1.9
Renamed the
type
property on Tile (Definition) and Objekt toclass
.Added
class
property to Karte, Tileset, Ebene, Wang Set and Wang Color.Added
x
,y
,width
andheight
properties to Tile (Definition), which store the sub-rectangle of a tile’s image used to represent this tile. By default the entire image is used.Added
tilerendersize
andfillmode
properties to Tileset, which affect the way tiles are rendered.
Tiled 1.8
Added support for user-defined custom property types. A reference to the type is saved as the new
propertytype
property of Eigenschaft.The Eigenschaft element can now have an arbitrary JSON object as its
value
, in case the property value is a class. In this case thetype
property is set to the new valueclass
.Added
parallaxoriginx
andparallaxoriginy
properties to Karte.Added
repeatx
andrepeaty
properties to Ebene (applies only to image layers at the moment).
Tiled 1.7
The Tile (Definition) objects in a tileset are no longer always saved with increasing IDs. They are now saved in the display order, which can be changed in Tiled.
Tiled 1.6
The
version
property is now written as a string („1.6“) instead of a number (1.5).
Tiled 1.5
Unified
cornercolors
andedgecolors
properties of Wang Set as the newcolors
property and added atype
field.Wang Color can now store
properties
.Added
transformations
property to Tileset (see Transformations).Removed
dflip
,hflip
andvflip
properties from Wang Tile (no longer supported).Added
parallaxx
andparallaxy
properties to the Ebene object.
Tiled 1.4
Added
objectalignment
to the Tileset object.Added
tintcolor
to the Ebene object.Added
object
as possible type of Eigenschaft.
Tiled 1.3
Added an
editorsettings
property to top-level Karte and Tileset objects, which is used to store editor specific settings that are generally not relevant when loading a map or tileset.Added support for Zstandard compression for tile layer data (
"compression": "zstd"
on tile layer objects).Added the
compressionlevel
property to the Karte object, which stores the compression level to use for compressed tile layer data.
Tiled 1.2
Added
nextlayerid
to the Karte object.Added
id
to the Ebene object.The tiles in a Tileset are now stored as an array instead of an object. Previously the tile IDs were stored as string keys of the „tiles“ object, now they are stored as
id
property of each Tile object.Custom tile properties are now stored within each Tile instead of being included as
tileproperties
in the Tileset object.Custom properties are now stored in an array instead of an object where the property names were the keys. Each property is now an object that stores the name, type and value of the property. The separate
propertytypes
andtilepropertytypes
properties have been removed.
Tiled 1.1
Added a chunked data format, currently used for infinite maps.
Templates were added. Templates can be stored as JSON files with an Objektvorlage object.
Tilesets can now contain Terrain Sets. They are saved in the new Wang Set object (since Tiled 1.1.5).