LDtk-rs

A crate for reading reading the [LDtk] 2D tile map format.

The LDtk map format is simply a JSON format, which allows us to read the map file using [serde]. This crate contains the serializable Rust structures corresponding to the map file JSON structure.

Example

```rust use ldtk::Project;

fn main() -> Result<(), Box> { // Load the map let map: Project = serdejson::fromslice(include_bytes!("../examples/full-features.ldtk"))?;

// Debug print the map
dbg!(map);

Ok(())

} ```

The entire crate is automatically generated from the JSON Schema in the LDtk repo.

Build Configuration & Features

By default, the crate will generate code for reading the LDtk format from built-in JSON Schema file, but you can also specify any version of LDtk newer than v0.7.0, or master in the LDTK_VERSION environment variable and enable the download-schema cargo feature at build time to have the crate automatically download the latest schema and build against that.

If you do not use the download-schema feature, you can still override the built-in schema to use. The currently available built-in schema versions are:

We will try to update the built-in schemas from time to time.

License

LDtk-rs is licensed under the Katharos License which places certain restrictions on what you are allowed to use it for. Please read and understand the terms before using LDtk-rs for your project.