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

Start minimised

Open spacekookie opened this issue 1 year ago • 1 comments

I looked at the configuration examples but I couldn't figure out a way to have the inspector there from the start but let the panel be minimised. Is there a way to do that I have missed or is it currently not possible? If not, would be great to add it

spacekookie avatar Aug 27 '24 15:08 spacekookie

It's currently not possible with the quick:: plugins, but they are meant to be able to be copy pasted easily into your own code where you can modify them to your liking:

app.add_plugins((DefaultInspectorConfigPlugin, EguiPlugin))
app.add_system(world_inspector_ui)

fn world_inspector_ui(world: &mut World) {
    let egui_context = world
        .query_filtered::<&mut EguiContext, With<PrimaryWindow>>()
        .get_single(world);

    let Ok(egui_context) = egui_context else {
        return;
    };
    let mut egui_context = egui_context.clone();

    egui::Window::new("World Inspector")
        .default_size(DEFAULT_SIZE) // you can set default_open(false) here
            .show(egui_context.get_mut(), |ui| {
            egui::ScrollArea::both().show(ui, |ui| {
                bevy_inspector::ui_for_world(world, ui);
                ui.allocate_space(ui.available_size());
            });
        });
}

jakobhellermann avatar Sep 13 '24 08:09 jakobhellermann