bevy_map

Crates.iobevy_map
lib.rsbevy_map
version0.3.1
created_at2025-12-22 10:36:03.873238+00
updated_at2026-01-20 11:19:04.061312+00
descriptionComplete 2D tilemap editor and runtime for Bevy games
homepage
repositoryhttps://github.com/jbuehler23/bevy_map_editor
max_upload_size
id1999498
size164,740
Joe Buehler (jbuehler23)

documentation

README

bevy_map

Complete 2D tilemap editor and runtime for Bevy games.

Part of bevy_map_editor.

Quick Start

Add to your Cargo.toml:

[dependencies]
bevy_map = "0.1"

Load and display a map:

use bevy::prelude::*;
use bevy_map::prelude::*;

fn main() {
    App::new()
        .add_plugins(DefaultPlugins)
        .add_plugins(MapRuntimePlugin)
        .add_systems(Startup, load_map)
        .run();
}

fn load_map(mut commands: Commands, asset_server: Res<AssetServer>) {
    commands.spawn(Camera2d);
    commands.spawn(MapHandle(asset_server.load("maps/level.map.json")));
}

Features

  • runtime (default) - Map loading and bevy_ecs_tilemap rendering
  • physics - Avian2D collision integration
  • hot-reload (default) - File watching for development
# With physics support
bevy_map = { version = "0.1", features = ["physics"] }

Modules

Module Description
prelude Common imports for most use cases
core Data types (Level, Layer, Tileset)
runtime Runtime loading and rendering
animation Sprite sheet animations
dialogue Branching dialogue trees
autotile Wang tile terrain system

Custom Entities

Define game entities that spawn from map data:

use bevy::prelude::*;
use bevy_map::prelude::*;

#[derive(Component, MapEntity)]
#[map_entity(type_name = "NPC")]
pub struct Npc {
    #[map_prop]
    pub name: String,
    #[map_prop(default = 100)]
    pub health: i32,
}

fn main() {
    App::new()
        .add_plugins(DefaultPlugins)
        .add_plugins(MapRuntimePlugin)
        .register_map_entity::<Npc>()
        .run();
}

License

MIT OR Apache-2.0

Commit count: 75

cargo fmt