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 above egui #112

Open
freiksenet opened this issue Jul 13, 2022 · 4 comments
Open

Rendering above egui #112

freiksenet opened this issue Jul 13, 2022 · 4 comments

Comments

@freiksenet
Copy link

Hi!

I'm trying to render a sprite (cursor image) above bevy_egui windows. Is it possible to do this?

@vladbat00
Copy link
Owner

Hi @freiksenet! Thanks for creating an issue.
To be honest, I've never tried this, but I think I'd start looking into how to create a custom render pass and render certain sprites during it.

Egui has RenderGraphConfig resource, and there you get can the egui_pass field to learn the name of the Egui pass and order them so that your custom pass runs before the Egui one.

You can probably get more help and some specific ideas/examples in Bevy discord. I'm not really experienced in rendering myself and kinda falling behind the recent changes. My guess is Bevy 0.8 might provide a simpler way of doing it.

If you do find out how to achieve that, I'll appreciate it if you share the solution here as well. I'm interested in adding this as a bevy_egui example.

Btw, I hope that in future Bevy will provide an API to set custom cursor images without having to rely on sprites.

@freiksenet
Copy link
Author

So far I ended up drawing what I wanted (cursor) in egui, instead of Bevy. This is a decent workaround, but probably not a universal one.

@spectria-limina
Copy link

This can probably be done in bevy 0.13 by using the camera-driven UI at bevyengine/bevy#10559, and rendering onto a Camera rather than directly to the Window. This would require reworking the bevy_egui render pipeline a bit so that it can target a Camera.

@Matheuswells
Copy link

Any new solution for this problem ?

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

4 participants