Crates.io Documentation License Workflow Status

ldtk2

A thin crate for people who just want to use ldtk files freely.

Why did I create this nonsense?

Supported LDtk file versions

^1.0.0

Usage

sh cargo add ldtk2

```rust use std::{error::Error, path::Path, convert::TryInto};

fn main() -> Result<(), Box> { use ldtk2::Ldtk;

let map = Ldtk::frompath("tests/example.ldtk")?; // or let map: Ldtk = Path::new("tests/example.ldtk").tryinto()?; // or let map = Ldtk::fromstr(includestr!("../tests/example.ldtk"))?; // or let map: Ldtk = includestr!("../tests/example.ldtk").tryinto()?;

Ok(()) } ```