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

How to specify the camera for Egui rendering? #315

Open
w4ngzhen opened this issue Oct 10, 2024 · 2 comments
Open

How to specify the camera for Egui rendering? #315

w4ngzhen opened this issue Oct 10, 2024 · 2 comments

Comments

@w4ngzhen
Copy link

Hello, bevy_egui is a great library! But may I ask, is there any way to specify the camera for Egui rendering? Or, how can I configure the viewport for Egui rendering?

@vladbat00
Copy link
Owner

Hi! Thank you for the kind words.

Atm, bevy_egui attaches its contexts either to windows or to textures. There are examples on how to render to a texture or to a different window:

Is it something that could work for you?

If not, maybe there's a way we could get context attachable to cameras. But I'd like to hear more about your use-case first :)

I think the only thing that attaching to a camera would bring is limiting Egui to a certain viewport size (which we don't have a clean API for atm), but everything else should be possible already if I'm not missing anything.

@w4ngzhen
Copy link
Author

Thank you very much for your reply. After careful consideration, I realized that my thoughts were indeed too complicated. My idea is that if bevy_egui can specify different cameras, then I can spawn a specific camera in certain scenarios and render the content of egui onto that specific camera. Now it seems that this scenario is too complex, perhaps I only need to display a widget at the specified location.

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