From 6c3b96d013e7f278b549ce1a2a8404034aa93f96 Mon Sep 17 00:00:00 2001 From: maddiebaka Date: Wed, 21 Jun 2023 22:14:54 -0400 Subject: [PATCH] Add a second line of a text --- src/main.rs | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/main.rs b/src/main.rs index 83ddede..f388e91 100644 --- a/src/main.rs +++ b/src/main.rs @@ -44,8 +44,18 @@ pub fn main() { let texture = texture_creator .create_texture_from_surface(&surface) .map_err(|e| e.to_string()).unwrap(); + + let surface2 = font + .render("TEROK NOR") + .blended(Color::RGBA(220, 220, 220, 255)) + .map_err(|e| e.to_string()).unwrap(); - let target = rect!(110, 20, 260, 24); + let texture2 = texture_creator + .create_texture_from_surface(&surface2) + .map_err(|e| e.to_string()).unwrap(); + + let target = rect!(90, 58, 300, 32); + let target2 = rect!(110, 20, 260, 32); canvas.set_draw_color(Color::RGB(0, 255, 255)); canvas.clear(); @@ -57,6 +67,7 @@ pub fn main() { canvas.set_draw_color(Color::RGB(48, 39, 49)); canvas.clear(); canvas.copy(&texture, None, Some(target)).unwrap(); + canvas.copy(&texture2, None, Some(target2)).unwrap(); for event in event_pump.poll_iter() { match event { Event::Quit {..} |