TMX is a library for loading Tiled maps in Rust.
bash
cargo add tmx
```rust use tmx::Map;
fn main() -> Result<(), Box
let map = Map::from_str(map)?;
println!("{:?}", map);
Ok(())
} ```
```rust use tmx::Tileset;
fn main() -> Result<(), Box
let tileset = Tileset::from_str(tileset)?;
println!("{:?}", tileset);
Ok(())
} ```
See the docs for more information.
| Element | Support |
| ------------------ | ------- |
| <map> | Full |
| <editorsettings> | None |
| - <chunksize> | None |
| - <export> | None |
| <tileset> | Partial |
| - <tileoffset> | None |
| - <grid> | None |
| - <image> | Full |
| - <terraintypes> | None |
| - - <terrain> | None |
| - <tile> | Partial |
| - - <animation> | None |
| - <wangsets> | None |
| - - <wangset> | None |
| <layer> | Full |
| - <data> | Full |
| - <chunk> | Full |
| - <tile> | Full |
| <objectgroup> | None |
| - <object> | None |
| - <ellipse> | None |
| - <point> | None |
| - <polygon> | None |
| - <polyline> | None |
| - <text> | None |
| <imagelayer> | None |
| <group> | None |
| <properties> | None |
| - <property> | None |
The following features are available and enabled by default.
| Feature | Description |
| ------------- | ----------------------------------------------------------------------------------- |
| base64-data | Allows loading maps where the Tile Layer Format is Base64 (uncompressed). |
| gzip-data | Allows loading maps where the Tile Layer Format is Base64 (gzip compressed). |
| zlib-data | Allows loading maps where the Tile Layer Format is Base64 (zlib compressed). |
| zstd-data | Allows loading maps where the Tile Layer Format is Base64 (Zstandard compressed). |