Skip to content

Instantly share code, notes, and snippets.

@whoisryosuke
Created April 24, 2023 19:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save whoisryosuke/47398df0ddd47a4159855658e5a81760 to your computer and use it in GitHub Desktop.
Save whoisryosuke/47398df0ddd47a4159855658e5a81760 to your computer and use it in GitHub Desktop.
egui / Bevy - Transparent Window styling
fn ui_example_system(mut contexts: EguiContexts) {
// Set window styles
let ctx = contexts.ctx_mut();
let old = ctx.style().visuals.clone();
ctx.set_visuals(egui::Visuals {
window_fill: Color32::TRANSPARENT,
panel_fill: Color32::TRANSPARENT,
window_stroke: egui::Stroke {
color: Color32::TRANSPARENT,
width: 0.0,
},
window_shadow: epaint::Shadow {
color: Color32::TRANSPARENT,
..old.window_shadow
},
..old
});
// Create window + UI
egui::Window::new("Hello").title_bar(false).show(ctx, |ui| {
ui.label("world");
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment