14 releases (6 breaking)

Uses new Rust 2021

new 0.7.4 Jan 13, 2022
0.7.3 Jan 12, 2022
0.6.1 Jul 24, 2021
0.5.1 May 18, 2021
0.1.1 Jan 18, 2021

#46 in Game dev

Download history 37/week @ 2021-09-26 73/week @ 2021-10-03 43/week @ 2021-10-10 67/week @ 2021-10-17 70/week @ 2021-10-24 42/week @ 2021-10-31 86/week @ 2021-11-07 105/week @ 2021-11-14 106/week @ 2021-11-21 106/week @ 2021-11-28 106/week @ 2021-12-05 69/week @ 2021-12-12 33/week @ 2021-12-19 65/week @ 2021-12-26 99/week @ 2022-01-02 255/week @ 2022-01-09

461 downloads per month

MIT license

310KB
4K SLoC

bevy-inspector-egui


This crate provides a debug interface using egui where you can visually edit the values of your components live.

demonstration with a running bevy app

Usage

You can either inspect a single resource using the InspectorPlugin, or use the WorldInspectorPlugin to inspect all entities.

InspectorPlugin

use bevy::prelude::*;
use bevy_inspector_egui::{InspectorPlugin, Inspectable};

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

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

World inspector

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

fn main() {
    App::new()
        .add_plugins(DefaultPlugins)
        .add_plugin(WorldInspectorPlugin::new())
        .run();
}
world inspector ui

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

If you want custom types to be displayed in the inspector, you'll need to register them on the InspectableRegistry:

use bevy::prelude::*;
use bevy_inspector_egui::{WorldInspector, RegisterInspectable};

#[derive(Reflect)]
struct ReflectedType;

#[derive(Reflect)]
struct InspectableType;

fn main() {
  App::build()
    .add_plugins(DefaultPlugins)
    .add_plugin(WorldInspectorPlugin::new())
    .register_type::<ReflectedType>()
    .register_inspectable::<InspectableType>()
    .run();
}

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

Bevy support table

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

Dependencies

~25MB
~523K SLoC