bevy-inspector-egui

Crates.io version docs.rs docs Download


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

```rust use bevyinspectoregui::Inspectable;

[derive(Inspectable, Default)]

struct Data { shouldrender: bool, text: String, #[inspectable(min = 42.0, max = 100.0)] size: f32, } Add the `InspectorPlugin` to your App. rust use bevyinspector_egui::InspectorPlugin;

fn main() { App::build() .addplugins(DefaultPlugins) .addplugin(InspectorPlugin::::new()) .addsystem(yoursystem.system()) .run(); }

// fn your_system(data: Res) { /* */ } ```

World Inspector

If you want to display all world entities you can add the WorldInspector: ```rust use bevyinspectoregui::WorldInspectorPlugin;

fn main() { App::build() .addplugins(DefaultPlugins) .addplugin(WorldInspectorPlugin::new()) .addstartupsystem(setup.system()) .run(); } `` You can configure it by inserting theWorldInspectorParams` 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.1-0.4| |0.4|0.1-0.3|