{"id":27375075,"url":"https://github.com/katharostech/ldtk-rs","last_synced_at":"2025-10-25T01:11:29.926Z","repository":{"id":52540149,"uuid":"326472480","full_name":"katharostech/ldtk-rs","owner":"katharostech","description":"A Rust crate for reading LDtk project files","archived":false,"fork":false,"pushed_at":"2021-04-26T18:55:18.000Z","size":120,"stargazers_count":12,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-13T12:14:16.991Z","etag":null,"topics":["json","rust"],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/katharostech.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-01-03T18:19:24.000Z","updated_at":"2024-05-17T18:30:01.000Z","dependencies_parsed_at":"2022-09-26T20:20:43.998Z","dependency_job_id":null,"html_url":"https://github.com/katharostech/ldtk-rs","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/katharostech%2Fldtk-rs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/katharostech%2Fldtk-rs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/katharostech%2Fldtk-rs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/katharostech%2Fldtk-rs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/katharostech","download_url":"https://codeload.github.com/katharostech/ldtk-rs/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248710448,"owners_count":21149191,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["json","rust"],"created_at":"2025-04-13T12:14:21.435Z","updated_at":"2025-10-25T01:11:24.881Z","avatar_url":"https://github.com/katharostech.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ldtk\n\n[![Crates.io](https://img.shields.io/crates/v/ldtk.svg)](https://crates.io/crates/ldtk)\n[![Docs.rs](https://docs.rs/ldtk/badge.svg)](https://docs.rs/ldtk)\n[![Katharos License](https://img.shields.io/badge/License-Katharos-blue)](https://github.com/katharostech/katharos-license)\n\nA crate for reading the [LDtk] tile map format.\n\nThis crate implements the Rust structures necessary to Serialize and Deserialize the LDtk map\nformat using [`serde`].\n\n## Example\n\n**`Cargo.toml`:**\n\n```toml\n# Note: We must specify the version of LDtk we want to support in a feature flag\nldtk = { version = \"0.4.0\", features = [\"ldtk-v0-9-3\"] }\n```\n\n**`main.rs`:**\n\n```rust\nuse ldtk::Project;\n\nfn main() -\u003e Result\u003c(), Box\u003cdyn std::error::Error\u003e\u003e {\n    // Load the map\n    let map: Project =\n        serde_json::from_slice(include_bytes!(\"../examples/full-features.ldtk\"))?;\n\n    // Debug print the map\n    dbg!(map);\n\n    Ok(())\n}\n```\n\n[ldtk]: https://github.com/deepnight/ldtk\n\n## Extra Documentation\n\nFor more information on using the LDtk project structure inside of games see the [LDtk\ndocs][ldtk_docs].\n\n## Naming Conventions\n\nThis crate uses the same struct field names as the raw JSON format in almost all cases. The\nexception to this rule is for fields that are named `type`. In this case the name of the field\nwill be prefixed with the name of it's struct, converted to snake case, for instance\n`field_def_type`.\n\n### The `__field_name` Convention\n\nIt is a convention of the LDtk map format to prefix certain convenience fields with two\nunderscores, such as `__tile_src_rect`. These fields are redundant, as the information in them\nis also present elsewhere in the project structure, but they are provided in some cases where it\nmay make traversing the project structure much more convenient.\n\nThe double underscore prefix does **not** indicate that the field is a private field or an\nimplementation detail.\n\n[ldtk_docs]: https://ldtk.io/docs/game-dev/json-overview/\n\n## Build Configuration \u0026 Features\n\nThis entire crate is automatically generated from the [JSON Schema](http://json-schema.org/)\nfrom the [LDtk repo](https://github.com/deepnight/ldtk/blob/master/docs/JSON_SCHEMA.json) and\ncan be automatically updated with LDtk releases.\n\nBy default the crate requires that you pass a feature indicating a version of the JSON schema\nthat is built into the crate so that it doesn't require network access to build, but you can\nalso supply the `download-schema` cargo feature to make the crate download the JSON schema from\nthe LDtk repo instead ( See \"Downloading the Schema\" below ).\n\nThis crate currently has the schema for the following versions of LDtk built-in:\n\n- `v0.9.3`\n- `v0.8.1` ( patched, see note below )\n- `v0.7.0`\n\nThe format of the feature flags for specific versions is like this: `ldtk-v0-9-3`. Note that the\nperiods in the version have been replaced with dashes to be conformat with cargo's feature\nnaming conventions.\n\n\u003e **Note:** In version 0.8.1 there was a field that was marked as non-null in the JSON schema,\n\u003e but in one of the LDtk sample maps the field was null. We patched the JSON schema to make the\n\u003e field nullable so that the map would load correctly.\n\nAs newer LDtk versions are released we may add new built-in schemas. These will each be under\nnew feature flags so that updates to the schema do not need to be breaking changes.\n\n### Downloading the Schema\n\nWhen the `download-schema` feature is provided, you can specify which version of LDtk you want\nto build this crate for by setting the `LDTK_VERSION` environment variable at build time.\n`LDTK_VERSION` will default to `master` which will pull the latest schema from the master branch\nof the LDtk git repo.\n\n## License\n\nLDtk-rs is licensed under the [Katharos License][k_license] which places certain restrictions on\nwhat you are allowed to use it for. Please read and understand the terms before using LDtk-rs\nfor your project.\n\n[k_license]: https://github.com/katharostech/katharos-license\n\n## Similar Projects \u0026 Bevy Integration\n\n- [`bevy_ldtk`](https://github.com/katharostech/bevy_ldtk): A Bevy plugin for loading LDtk maps that uses this crate.\n- [`ldtk_rust`](https://github.com/estivate/ldtk_rust): modified version of the LDtk bindings created by [QuickType](https://github.com/quicktype/quicktype), with a good Bevy example that is hopefully useful for non-Bevy game engines, too.\n- Another [`bevy-ldtk`](https://github.com/tigregalis/bevy-ldtk): Work-in-progress Bevy plugin for loading LDtk maps.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkatharostech%2Fldtk-rs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkatharostech%2Fldtk-rs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkatharostech%2Fldtk-rs/lists"}