#bevy #ldtk #game #gamedev #map-editor


An ECS-friendly ldtk plugin for bevy

5 releases (breaking)

0.5.0 Nov 20, 2022
0.4.0 Aug 17, 2022
0.3.0 Apr 25, 2022
0.2.0 Feb 25, 2022
0.1.0 Jan 16, 2022

#111 in Game dev

Download history 183/week @ 2022-12-02 161/week @ 2022-12-09 128/week @ 2022-12-16 117/week @ 2022-12-23 98/week @ 2022-12-30 335/week @ 2023-01-06 114/week @ 2023-01-13 151/week @ 2023-01-20 151/week @ 2023-01-27 124/week @ 2023-02-03 108/week @ 2023-02-10 165/week @ 2023-02-17 105/week @ 2023-02-24 133/week @ 2023-03-03 112/week @ 2023-03-10 95/week @ 2023-03-17

474 downloads per month




crates.io docs.rs crates.io MIT/Apache 2.0 Bevy tracking CI

An ECS-friendly LDtk plugin for bevy. Uses bevy_ecs_tilemap as a base.


cargo run --example platformer --release


  • Support for all layer types
  • Support for loading external levels
  • Hot reloading (requires double-saving for external levels)
  • Solutions for easily loading/unloading levels, changing levels, loading level neighbors...
  • Low-boilerplate solutions for spawning bundles for LDtk Entities and IntGrid tiles using derive macros (other options available)
  • serde types for LDtk based off LDtk's QuickType loader, but with several QoL improvements
  • Support for Wasm (and tile spacing) through "atlas" feature

Getting Started

The goal of this plugin is to make it as easy as possible to use LDtk with bevy for common use cases, while providing solutions to handle more difficult cases. You only need a few things to get started:

  1. Add the LdtkPlugin to the App
  2. Insert the LevelSelection resource into the App to pick your level
  3. Spawn an LdtkWorldBundle
  4. Optionally, use #[derive(LdtkEntity)] and #[derive(LdtkIntCell)] on bundles and register them to the App to automatically spawn those bundles on Entity and IntGrid layers.
use bevy::prelude::*;
use bevy_ecs_ldtk::prelude::*;

fn main() {

fn setup(mut commands: Commands, asset_server: Res<AssetServer>) {

    commands.spawn(LdtkWorldBundle {
        ldtk_handle: asset_server.load("my_project.ldtk"),

#[derive(Bundle, LdtkEntity)]
pub struct MyBundle {
    a: ComponentA,
    b: ComponentB,
    sprite_bundle: SpriteSheetBundle,

There are other attributes available to #[derive(LdtkEntity)] and #[derive(LdtkIntCell)], see the documentation for more details.

By default, LDtk Entities and IntGrid tiles get spawned with EntityInstance and IntGridCell components respectfully. So, you can flesh out these entities in a system that queries for Added<EntityInstance> or Added<IntGridCell> if you need more access to the world, or if you just don't want to use the LdtkEntity and LdtkIntCell traits.

To load a new level, you can just update the LevelSelection resource. Be sure to check out the LdtkSettings resource and the LevelSet component for additional level-loading options.


bevy bevy_ecs_tilemap LDtk bevy_ecs_ldtk
0.9 0.9 1.1 0.5
0.8 0.7 1.1 0.4
0.7 0.6 1.1 0.3
0.6 0.5 0.9 0.2
0.6 0.5 0.9 0.1

Asset Credits


~586K SLoC