From 4877508e16196515abd5118880a6c412f1f662f4 Mon Sep 17 00:00:00 2001 From: Dzmitry Malyshau Date: Mon, 23 Oct 2023 00:28:09 -0700 Subject: [PATCH] Make GUI transparent --- examples/scene/main.rs | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/examples/scene/main.rs b/examples/scene/main.rs index daa2632d..152a5180 100644 --- a/examples/scene/main.rs +++ b/examples/scene/main.rs @@ -778,12 +778,15 @@ fn main() { let mut quit = false; let raw_input = egui_winit.take_egui_input(&window); let egui_output = egui_ctx.run(raw_input, |egui_ctx| { - egui::SidePanel::right("control_panel").show(egui_ctx, |ui| { - example.add_gui(ui); - if ui.button("Quit").clicked() { - quit = true; - } - }); + let frame = egui::Frame::default().fill(egui::Color32::from_white_alpha(0x80)); + egui::SidePanel::right("control_panel") + .frame(frame) + .show(egui_ctx, |ui| { + example.add_gui(ui); + if ui.button("Quit").clicked() { + quit = true; + } + }); }); egui_winit.handle_platform_output(&window, &egui_ctx, egui_output.platform_output);