Expand description

§Bevy_Sparse_Tilemap

A relatively simple, sparse style tilemap for the Bevy Game Engine.

§Tilemap Construction

bevy_sparse_tilemap includes a TilemapBuilder SystemParam that is used to spawn and setup a tilemap correctly in the world.

fn spawn_tilemap(mut tilemap_builder: TilemapBuilder<TileData, MapLayers>, mut commands: Commands) {
    tilemap_builder.new_tilemap_with_main_layer(
        TilemapLayer::new_dense_default(5000,5000),
        ChunkSettings {
            max_chunk_size: UVec2::new(100, 100),
        },
    );
    let tilemap = tilemap_builder.spawn_tilemap();
}

§Tilemap Access

bevy_sparse_tilemap includes a handy TilemapManager system param that has a bevy of helper functions to make accessing, editing, and interacting with tilemaps that much easier.


fn access(tilemap_manager: TilemapManager<TileData, MapLayers>, mut commands: Commands) {
    let tile_data = tilemap_manager.get_tile_data(TilePos::new(9,16)).unwrap();

    //    

}

Re-exports§

Modules§

Macros§

  • Init a grid with values.

Structs§

Derive Macros§