| Crates.io | bevy_minibuffer_inspector |
| lib.rs | bevy_minibuffer_inspector |
| version | 0.2.0 |
| created_at | 2025-01-01 10:12:20.911581+00 |
| updated_at | 2025-04-26 10:46:26.966591+00 |
| description | A minibuffer integration of bevy-inspector-egui |
| homepage | |
| repository | https://github.com/shanecelis/bevy_minibuffer_inspector |
| max_upload_size | |
| id | 1500704 |
| size | 203,439 |
Inspect bevy worlds, assets, resources, and more with bevy_minibuffer and bevy-inspector-egui.
This crate merely adapts a gamedev console to invoke bevy-inspector-egui's inspectors. The inspectors themselves are a wonder of that crate.
The Minibuffer acts, i.e., commands, this crate makes available are:
They may be used a la carte.
WorldActs provides 'inspect_world' act.
use bevy::prelude::*;
use bevy_minibuffer::prelude::*;
use bevy_minibuffer_inspector as inspector;
fn plugin(app: &mut App) {
app
.add_plugins(MinibufferPlugins)
.add_acts((
BasicActs::default(),
inspector::WorldActs::default(),
));
}
There is no configuration required for WorldActs unless you want to add a key
binding.
use bevy::prelude::*;
use bevy_minibuffer::prelude::*;
use bevy_minibuffer_inspector as inspector;
fn plugin(app: &mut App) {
app
.add_plugins(MinibufferPlugins)
.add_acts((
BasicActs::default(),
inspector::WorldActs::default()
.configure("inspect_world", |mut act| {
act.bind(keyseq! { I W });
}),
));
}
ResourceActs provides the 'inspect_resource' act. Register the resources that
it prompts for. If no resources are registered, a warning will be emitted in the
logs and the 'inspect_resource' act will report that there are no resources
available when run.
use bevy::prelude::*;
use bevy_minibuffer::prelude::*;
use bevy_minibuffer_inspector as inspector;
#[derive(Resource, Reflect)]
struct Configuration { verbose: bool };
fn plugin(app: &mut App) {
app
.add_plugins(MinibufferPlugins)
.add_acts((
BasicActs::default(),
inspector::ResourceActs::default()
.add::<Configuration>(),
));
}
AssetActs provides the 'inspect_asset' act. Register the assets that it
prompts for. If no assets are registered, a warning will be emitted in the
logs and the 'inspect_asset' act will report that there are no assets
available when run.
use bevy::prelude::*;
use bevy_minibuffer::prelude::*;
use bevy_minibuffer_inspector as inspector;
fn plugin(app: &mut App) {
app
.add_plugins(MinibufferPlugins)
.add_acts((
BasicActs::default(),
inspector::AssetActs::default()
.add::<StandardMaterial>(),
));
}
StateActs provides the 'inspect_state' act. Register the states that it
prompts for. If no states are registered, a warning will be emitted in the
logs and the 'inspect_state' act will report that there are no states
available when run.
use bevy::prelude::*;
use bevy_minibuffer::prelude::*;
use bevy_minibuffer_inspector as inspector;
#[derive(States, Debug, Clone, Eq, PartialEq, Hash, Reflect)]
enum AppState { A, B, C }
fn plugin(app: &mut App) {
app
.add_plugins(MinibufferPlugins)
.add_acts((
BasicActs::default(),
inspector::StateActs::default()
.add::<AppState>(),
));
}
FilterQueryActs provides the 'inspect_filter_query' act. Register the filters
that it prompts for. If no filter queries are registered, a warning will be
emitted in the logs and the 'inspect_filter querie' act will report that there
are no filter queries available when run.
This is probably one of the most useful ways to get at exactly what one's interested in.
use bevy::prelude::*;
use bevy_minibuffer::prelude::*;
use bevy_minibuffer_inspector as inspector;
fn plugin(app: &mut App) {
app
.add_plugins(MinibufferPlugins)
.add_acts((
BasicActs::default(),
inspector::FilterQueryActs::default()
.add::<With<Transform>>()
.add::<With<Mesh3d>>(),
));
}
No key bindings are defined. Users are welcome to add them.
use bevy_minibuffer::prelude::*;
use bevy_minibuffer_inspector as inspector;
let mut inspector_acts = inspector::WorldActs::default();
inspector_acts.acts_mut().configure("inspect_world", |mut act| {
act.bind(keyseq! { I W });
});
I wonder if maybe some bindings like this would work:
I WI RI AI SI FDESIGN NOTE: There may be ways to automatically register various assets, resources, and other types but I would actually decline to do that as of now. It can quickly make a mess, become overwhelming, and takes control out of the user's hands.
Each act toggles the visibility of its inspector. However, each inspector's visibility is tied to Minibuffer's visibility. When Minibuffer is invisible so are its inspectors and vice versa.
NOTE: Any inspectors configured without the minibuffer module are independent of minibuffer's influence.
| bevy_minibuffer_inspector | bevy_minibuffer | bevy |
|---|---|---|
| 0.1.0 | 0.3 | 0.15 |
This crate is licensed under the MIT License or the Apache License 2.0.
Many thanks to Jakob Hellermann for bevy-inspector-egui which I am constantly reaching for to dig into my Bevy projects with. It is for that reason it is the first integration I made for bevy_minibuffer.