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

Displaying only specific components in component inspector. #222

Open
erikhoj opened this issue Nov 16, 2024 · 1 comment
Open

Displaying only specific components in component inspector. #222

erikhoj opened this issue Nov 16, 2024 · 1 comment

Comments

@erikhoj
Copy link

erikhoj commented Nov 16, 2024

Hello!

I used your egui_dock example to get a basic editor up and running. I'm trying to tailor it to my specific use-case. When displaying the UI for the selected entities, I use the following logic:

EguiWindow::Inspector => match *self.selection {
    InspectorSelection::Entities => match self.selected_entities.as_slice() {
        &[entity] => ui_for_entity_with_children(self.world, entity, ui),
        entities => ui_for_entities_shared_components(self.world, entities, ui),
    },
    ...
}

I want to filter the Components that are shown in the editor, so I only show specific component types that I have marked as visible. Currently it shows every single component on the Entity, even if they are not properly registered in the TypeRegistry. Is there some way that I can configure bevy_inspector to only show specific component types when calling the above functions?

image
@rydb
Copy link

rydb commented Dec 2, 2024

Hello!
I want to filter the Components that are shown in the editor, so I only show specific component types that I have marked as visible.

I have a library I've been working on that uses this library as a backend to do that.
https://github.com/rydb/bevy_ui_extras
E.G, to visualize Transform in it:

visualize_components_for::<Transform>(bevy_ui_extras::Display::Side(Side::Right)),

I'm going to be updating it to 0.15 and bug-fixing it, hopefully sometime in the future, I could make a pr to merge single component displays into this library though!

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