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

Revisions/fixes to the slides.

parent 437a3ea9
No related branches found
No related tags found
No related merge requests found
......@@ -2,10 +2,10 @@ use crate::component::image::Image;
use crate::egui::{Align2, Context};
use crate::fade_in::fade_in;
use crate::slide::Slide;
use crate::window::WindowPosition;
use crate::{ctx_img, Margin};
use eframe::egui::{Frame, TextureHandle, Ui, Vec2, Window};
use eframe::emath::Pos2;
use crate::window::WindowPosition;
/// The first slide in the cartoon.
#[derive(Default)]
......@@ -64,7 +64,10 @@ impl Slide for Title {
for (i, example) in self.examples.iter().enumerate() {
let row = i / COLUMNS;
let column = i % COLUMNS;
let position = Pos2::new(column as f32 * available.y / ROWS as f32, row as f32 * available.y / ROWS as f32) + Vec2::new(62.0,16.0);
let position = Pos2::new(
column as f32 * available.y / ROWS as f32,
row as f32 * available.y / ROWS as f32,
) + Vec2::new(62.0, 16.0);
Image::default()
.height(available.y * 0.295)
.position(WindowPosition::Global(position))
......
#[allow(unused)]
use crate::fade_in::fade_in;
use crate::slide::Slide;
use eframe::egui::style::Margin;
......@@ -5,10 +6,12 @@ use eframe::egui::{Context, Frame, Ui};
/// A slide that sets some expectations about generative art.
#[derive(Default)]
#[allow(unused)]
pub struct Introduction {
state: IntroductionState,
}
#[allow(unused)]
#[derive(Default)]
enum IntroductionState {
#[default]
......@@ -20,7 +23,11 @@ enum IntroductionState {
}
impl Slide for Introduction {
#[rustfmt::skip]
#[allow(unused)]
fn transition(&mut self, ctx: &Context) -> bool {
true
/*
match self.state {
IntroductionState::Weaknesses => {
self.state = IntroductionState::Strengths {
......@@ -30,27 +37,32 @@ impl Slide for Introduction {
}
IntroductionState::Strengths { .. } => true,
}
*/
}
#[rustfmt::skip]
fn show(&mut self, ui: &mut Ui) {
Frame::none().margin(Margin::same(20.0)).show(ui, |ui| {
ui.heading("Introduction to Artistic Algorithms");
ui.add_space(8.0);
/*
ui.label("Weaknesses");
ui.small(" ✖ Social context");
ui.small(" ✖ Human emotion");
ui.small(" ✖ Political commentary");
*/
if let IntroductionState::Strengths { transition_time } = &self.state {
fade_in(ui, *transition_time, |ui| {
//if let IntroductionState::Strengths { transition_time } = &self.state {
//fade_in(ui, *transition_time, |ui| {
ui.add_space(10.0);
ui.label("Strengths");
ui.small(" ✔ Following rules");
ui.small(" ✔ Performing computation");
ui.small(" ✔ Harnessing chaos and randomness");
ui.small(" ✔ Guided exploration");
});
}
//});
//}
});
}
}
......@@ -73,7 +73,7 @@ impl Default for Watercolor {
};
Self {
image: img!("test/mud0.png"),
image: img!("test/squirrel0.png"),
texture: None,
grid,
state: WatercolorState::default(),
......
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