bevy-inspector-egui
bevy-inspector-egui copied to clipboard
Customize inspector window attributes
Is there a way to customize the inspector's window size, border radius, resizability, etc?
Adding a startup system that sets the egui style worked for me. For example this removes the window shadow and makes the rounding of the corners smaller.
pub fn set_ui_theme(mut ctx: ResMut<EguiContext>) {
ctx.ctx_mut().set_style(egui::Style {
visuals: egui::Visuals {
window_rounding: Rounding::same(1.5),
window_shadow: Shadow {
extrusion: 0.0,
color: Default::default(),
},
..egui::Visuals::dark()
},
..Default::default()
});
}
You would add that system to your app like this:
app.add_startup_system(set_ui_theme)
Here's the docs for Style to see what you can change: https://docs.rs/egui/0.19.0/egui/style/struct.Style.html
The crate now exposes functions like ui_for_world
so you can easily display it in whatever window you want:
https://github.com/jakobhellermann/bevy-inspector-egui/blob/863191c2fa7898dd451f64b09e77012b7778a26f/crates/bevy-inspector-egui/src/quick.rs#L51-L77