Created
April 24, 2023 19:48
-
-
Save whoisryosuke/47398df0ddd47a4159855658e5a81760 to your computer and use it in GitHub Desktop.
egui / Bevy - Transparent Window styling
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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