Closed Shrav108 closed 2 months ago
Hi. Take a look at the examples/side_panel.rs
and examples/render_to_image_widget.rs
examples. These have two different approaches: the side_panel
one just renders side panels on top of Bevy while shifting the camera a bit (based on the width of the side panels); the examples/render_to_image_widget.rs
shows how to render something to a texture and then show that texture as an image in Egui.
The first one should be easier to set up, even though it's a bit further from the "Bevy app inside Egui" idea, it should be visually indistinguishable.
These examples are fine. But they are using egui plugin and creating the app. What I would like is that I want to plug the bevy engine into my egui app. My egui app has many sub apps embedded. I want to plug this feature into that egui app. How do I do that ?
What exactly do you mean by Egui app? Are you using some different backend like eframe
and want to integrate a Bevy app into it? If so, I don't know of any easy way to do that. Any particular reason why you want to use a different backed for the main window? If you are going to use Bevy, maybe it's easier to just use it as a main backend instead - can that work for you?
Egui app is :
fn main() -> eframe::Result {
let options = eframe::NativeOptions {
// CODE
};
eframe::run_native(
"My egui App",
options,
Box::new(|cc| {
Ok(Box::<MyApp>::default())
}),
)
}
struct MyApp {
// EMBED BEVY APP HERE
}
This is my backend. Bevy app to be embedded in MyApp.
I already have eframe
as backend. I can't use bevy
as main backend.
Sry, I'm afraid this is not something I can help you with. bevy_egui
is meant to be used only with Bevy as a main backend. I don't think the opposite is really feasible
Thank you for your response. I guess I have to look for other ways.
Hi, can anyone tell me how to plug a bevy app inside an egui app ? I want to display .stl file in my egui app