
( Tileset from ["Cavernas"] by Adam Saltsman )
A [Bevy] plugin for loading [LDtk] tile maps.
```rust use bevy::prelude::; use bevy_ldtk::;
fn main() { App::build() .addplugins(DefaultPlugins) .addplugin(LdtkPlugin) .addstartupsystem(setup.system()) .run(); }
fn setup(commands: &mut Commands, assetserver: ResTransform instead of putting the top-left
// corner of the map at the origin Transform.
center_map: true,
},
..Default::default()
});
}
```
When the map layers are spawned, the bottommost layer is spawned at the transform coordinate of
the LdtkMapBundle's Transform component. Each layer after the bottom layer is placed one
unit higher on the Z axis. To have your sprites for players, etc. appear on top of the rendered
map, their Z axis translation must be higher than the map transform + the layer number that you
want it to appear above.
| Bevy Version | Plugin Version |
| ------------ | -------------------------------------------------- |
| 0.4 | 0.2, 0.3 |
| master | 0.3 with the bevy-unstable feature ( see below ) |
You can use this crate with Bevy master by adding a patch to your Cargo.toml and by adding the
bevy-unstable feature to this crate:
```toml [dependencies]
bevy = "0.4" bevy_ldtk = { version = "0.3", features = ["bevy-unstable"] }
[patch.crates-io] bevy = { git = "https://github.com/bevyengine/bevy.git" } ```
Note that as Bevy master may or may not introduce breaking API changes, this crate may or may
not compile when using the bevy-unstable feature.
The plugin is in relatively early stages, but it is still rather functional for many basic maps
If you run into anything that isn't supported that you want to use in your game open an issue or PR to help prioritize what gets implemented.
Bevy LDtk 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 Bevy LDtk for your project.