bevy-inspector-egui

Crates.io version docs.rs docs Download


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

```rust use bevy::prelude::*; use bevyinspectoregui::{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() .addplugins(DefaultPlugins) .addplugin(InspectorPlugin::::new()) .run(); } ```

World inspector

```rust use bevy::prelude::*; use bevyinspectoregui::WorldInspectorPlugin;

fn main() { App::new() .addplugins(DefaultPlugins) .addplugin(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:

```rust use bevy::prelude::*; use bevyinspectoregui::{WorldInspector, RegisterInspectable};

[derive(Reflect)]

struct ReflectedType;

[derive(Reflect)]

struct InspectableType;

fn main() { App::build() .addplugins(DefaultPlugins) .addplugin(WorldInspectorPlugin::new()) .registertype::() .registerinspectable::() .run(); } `` More examples (with pictures) can be found in the [examples folder`](examples).

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 |