bevy-inspector-egui icon indicating copy to clipboard operation
bevy-inspector-egui copied to clipboard

Customize inspector window attributes

Open jf908 opened this issue 2 years ago • 1 comments

Is there a way to customize the inspector's window size, border radius, resizability, etc?

jf908 avatar May 13 '22 15:05 jf908

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

paul-hansen avatar Aug 26 '22 14:08 paul-hansen

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

jakobhellermann avatar Jan 05 '23 20:01 jakobhellermann