Skip to content
Snippets Groups Projects
Commit 9209ea1c authored by Finn Bear's avatar Finn Bear
Browse files

Revise slides 8 and 9.

parent 6eabc81e
No related branches found
No related tags found
No related merge requests found
......@@ -223,7 +223,7 @@ impl Slide for Watercolor {
Frame::none().margin(Margin::same(20.0)).show(ui, |ui| {
ui.heading("Generative Image Processing");
if let &WatercolorState::Triangles {start, ..} = &self.state {
if let &WatercolorState::Triangles { start, .. } = &self.state {
fade_in(ui, start, |ui| {
ui.add_space(ui.available_height() - 50.0);
ui.centered_and_justified(|ui| {
......
use crate::egui::text::LayoutJob;
use crate::egui::Ui;
use crate::slide::Slide;
use eframe::egui::style::Margin;
use eframe::egui::Frame;
use eframe::egui::{FontFamily, FontId, Frame, Sense, Shape, Stroke, TextFormat};
use eframe::epaint::TextShape;
#[derive(Default)]
pub struct Conclusion {}
......@@ -15,7 +17,42 @@ impl Slide for Conclusion {
Frame::none().margin(Margin::same(20.0)).show(ui, |ui| {
ui.heading("Conclusion");
ui.add_space(8.0);
ui.label("Oh by the way, this entire cartoon was rendered by code!");
let font_size = 30.0;
let color = ui.style().visuals.widgets.noninteractive.fg_stroke.color;
let mut job = LayoutJob::default();
job.append(
"In the spirit of generative art, ",
0.0,
TextFormat {
font_id: FontId::new(font_size, FontFamily::Proportional),
color,
..Default::default()
},
);
job.append(
"this entire cartoon was rendered by code",
0.0,
TextFormat {
font_id: FontId::new(font_size, FontFamily::Monospace),
color,
underline: Stroke::new(1.5, color),
..Default::default()
},
);
job.append(
"!",
0.0,
TextFormat {
font_id: FontId::new(font_size, FontFamily::Proportional),
color,
..Default::default()
},
);
let galley = ui.fonts().layout_job(job);
let (rect, _) = ui.allocate_exact_size(galley.size(), Sense::hover());
ui.painter()
.add(Shape::Text(TextShape::new(rect.left_top(), galley)));
});
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment