TmxData
When no encoding or compression is given, the tiles are stored as individual XML tile elements. Next to that, the easiest format to parse is the "csv" (comma separated values) format.
The base64-encoded and optionally compressed layer data is somewhat more complicated to parse. First you need to base64-decode it, then you may need to decompress it. Now you have an array of bytes, which should be interpreted as an array of unsigned 32-bit integers using little-endian byte ordering.
Whatever format you choose for your layer data, you will always end up with so called "global tile IDs" (gids). They are global, since they may refer to a tile from any of the tilesets used by the map. In order to find out from which tileset the tile is you need to find the tileset with the highest firstgid that is still lower or equal than the gid. The tilesets are always stored with increasing firstgids.
Instance Members
The encoding used to encode the tile layer data. When used, it can be "base64" and "csv" at the moment.
The compression used to compress the tile layer data. Tiled Qt supports "gzip" and "zlib". Optional
Decoded tile data
Infinite maps chunk data
data: haxe.io.Bytes
Raw data. Exists for non-tile-layer data objects.
new(?encoding: Anonymous, ?compression: Anonymous, ?tiles: Array<TmxTile>, ?chunks: Array<TmxChunk>, ?data: haxe.io.Bytes): Void
Name | Type | Default | Description |
---|---|---|---|
encoding |
Anonymous | (optional) | The encoding used to encode the tile layer data. When used, it can be "base64" and "csv" at the moment. |
compression |
Anonymous | (optional) | The compression used to compress the tile layer data. Tiled Qt supports "gzip" and "zlib". Optional |
tiles |
Array<TmxTile> | (optional) | Decoded tile data |
chunks |
Array<TmxChunk> | (optional) | Infinite maps chunk data |
data |
haxe.io.Bytes | (optional) | Raw data. Exists for non-tile-layer data objects. |
Metadata
Name | Parameters |
---|---|
:structInit |
- |