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

Rendering egui to a plane/Camera2d #163

Closed
thedoctor3141 opened this issue Mar 13, 2023 · 2 comments
Closed

Rendering egui to a plane/Camera2d #163

thedoctor3141 opened this issue Mar 13, 2023 · 2 comments

Comments

@thedoctor3141
Copy link

I've been reading the source code and docs for a while, and I'm frankly lost. I don't want to change the gui component rendering, shaders, or asset management, I know I'll need to override the input, but from what I've read, that should be manageable. I just.. don't see how to create a context with the available render system, and restrict it to a specific Camera. Thanks for any assistance.

Side note: I did notice another topic wanting to render on top of egui. Restructuring the rendering in the manner described above might make that easier.

@aevyrie
Copy link
Contributor

aevyrie commented Apr 7, 2023

Right now it looks like egui always assumes it is rendering to a window, as it assumes it is tied to an Entity that has a Window:

fn create_new_window_system(mut commands: Commands) {

Instead, it would probably need to be flipped, so that each egui context must be associated with a Camera, not a Window. Just like Bevy's rendering, egui would render to that Camera's RenderTarget, which can be a Window or an Image. From there, you can apply that Handle<Image> to whatever you want - a plane or any arbitrary mesh.

@mvlabat
Copy link
Owner

mvlabat commented Aug 18, 2024

Rendering UI to worldspace should now be possible (we still lack a proper input handling though, I'll probably fix this once Bevy 0.15 lands).

@mvlabat mvlabat closed this as completed Aug 18, 2024
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

3 participants