Newer
Older
#[derive(Default)]
pub struct Title {
examples: Vec<egui::TextureHandle>,
}
impl Slide for Title {
// For now, these images are somewhat like placeholders.
ctx_img!(ui.ctx(), "raymarching0.png"),
ctx_img!(ui.ctx(), "raymarching1.png"),
ctx_img!(ui.ctx(), "atom0.png"),
ctx_img!(ui.ctx(), "atom1.png"),
ctx_img!(ui.ctx(), "atom2.png"),
for example in &self.examples {
Window::new(example.name())
.title_bar(false)
.resizable(false)
// Reduce margin of example images.
.frame(Frame::window(&ui.style()).margin(Margin::same(5.0)))
.show(ui.ctx(), |ui| {
ui.image(example, Vec2::splat(128.0));
});
}
Window::new("title")
.title_bar(false)
.resizable(false)
.anchor(Align2::CENTER_CENTER, Vec2::ZERO)
.frame(Frame::window(ui.style()))
.show(ui.ctx(), |ui| {