diff options
fix: new dither pattern cuz cute
-rw-r--r-- | src/main.rs | 41 |
1 files changed, 21 insertions, 20 deletions
diff --git a/src/main.rs b/src/main.rs index da399b5..211eaab 100644 --- a/src/main.rs +++ b/src/main.rs @@ -63,6 +63,26 @@ pub fn main() { offset += char.advance_width; } + offset = 0.0; + let mut rng = rand::thread_rng(); + + for c in "look sorry for shit demo we have adhd".chars() { + let char = FONT_GALMURI.get_char(c); + canvas + .copy( + &char + .to_texture(&texture_creator, Color::RGB(i, 64, 255 - i)) + .unwrap(), + None, + char.to_rect( + offset as i32 + 18 + rng.gen_range(-2..2), + 16 + 36 * 2 + rng.gen_range(-2..2), + ), + ) + .unwrap(); + offset += char.advance_width / 1.0; + } + { let mut sin_surface = Surface::new(512, 256, PixelFormatEnum::RGBA32).unwrap(); @@ -90,7 +110,7 @@ pub fn main() { f[idx + 1] = 255 - (x / 2) as u8; f[idx + 2] = (x / 2) as u8; f[idx + 3] = if sin_y < y as usize { - if idx % 3 == 0 { + if idx % 5 == 0 { 255 } else { 122 @@ -132,25 +152,6 @@ pub fn main() { _ => {} } } - offset = 0.0; - let mut rng = rand::thread_rng(); - - for c in "look sorry for shit demo we have adhd".chars() { - let char = FONT_GALMURI.get_char(c); - canvas - .copy( - &char - .to_texture(&texture_creator, Color::RGB(i, 64, 255 - i)) - .unwrap(), - None, - char.to_rect( - offset as i32 + 18 + rng.gen_range(-2..2), - 16 + 36 * 2 + rng.gen_range(-2..2), - ), - ) - .unwrap(); - offset += char.advance_width / 1.0; - } for event in event_pump.poll_iter() { match event { Event::Quit { .. } |