Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Start minimised #216

Open
spacekookie opened this issue Aug 27, 2024 · 1 comment
Open

Start minimised #216

spacekookie opened this issue Aug 27, 2024 · 1 comment

Comments

@spacekookie
Copy link

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

@jakobhellermann
Copy link
Owner

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());
            });
        });
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants