9 releases (5 breaking)

0.6.1 Jul 24, 2021
0.5.1 May 18, 2021
0.4.1 Apr 10, 2021
0.3.0 Jan 24, 2021
0.1.1 Jan 18, 2021

#83 in Game dev

Download history 45/week @ 2021-06-03 112/week @ 2021-06-10 65/week @ 2021-06-17 73/week @ 2021-06-24 50/week @ 2021-07-01 56/week @ 2021-07-08 68/week @ 2021-07-15 60/week @ 2021-07-22 125/week @ 2021-07-29 93/week @ 2021-08-05 77/week @ 2021-08-12 409/week @ 2021-08-19 581/week @ 2021-08-26 45/week @ 2021-09-02 70/week @ 2021-09-09 57/week @ 2021-09-16

266 downloads per month

MIT license

325KB
4K SLoC

bevy-inspector-egui


This crate provides the ability to annotate structs with a #[derive(Inspectable)], which opens a debug interface using egui where you can visually edit the values of your struct live.

Your struct will then be available to you as a bevy resource.

demonstration with a running bevy app

More examples (with pictures) can be found in the examples folder.

Example

use bevy_inspector_egui::Inspectable;

#[derive(Inspectable, Default)]
struct Data {
    should_render: bool,
    text: String,
    #[inspectable(min = 42.0, max = 100.0)]
    size: f32,
}

Add the InspectorPlugin to your App.

use bevy_inspector_egui::InspectorPlugin;

fn main() {
    App::build()
        .add_plugins(DefaultPlugins)
        .add_plugin(InspectorPlugin::<Data>::new())
        .add_system(your_system.system())
        .run();
}

// fn your_system(data: Res<Data>) { /* */ }

World Inspector

If you want to display all world entities you can add the WorldInspectorPlugin:

use bevy::prelude::*;
use bevy_inspector_egui::WorldInspectorPlugin;

fn main() {
    App::build()
        .add_plugins(DefaultPlugins)
        .add_plugin(WorldInspectorPlugin::new())
        .add_startup_system(setup.system())
        .run();
}

You can configure it by inserting the WorldInspectorParams resource. If you want to only display some components, you may want to use the InspectorQuery instead.

world inspector ui

Bevy support table

bevy bevy-inspector-egui
0.5-0.6 0.5
0.5 0.4
0.4 0.1-0.3

Dependencies

~14–29MB
~472K SLoC