From 7df8646d4f84eb183caca2fa2b1dfe64bb701776 Mon Sep 17 00:00:00 2001 From: Oliver Atkinson Date: Tue, 1 Oct 2024 15:39:01 -0600 Subject: [PATCH] text vars --- src/main.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/main.rs b/src/main.rs index a966c90..af719e6 100644 --- a/src/main.rs +++ b/src/main.rs @@ -22,8 +22,10 @@ async fn main() { loop { clear_background(BLACK); if show_debug { - draw_text(&format!("Amplitude: {}, Freqency {}, X Offset {}", amp, freq, x_offset), 20.0, 40.0, 20.0, WHITE); - draw_text(&format!("Cursor {:?}, Last Click {:?}", mouse_position(), (inital_x_pos, inital_y_pos)), 20.0, 60.0, 20.0, WHITE); + let text_h = 20.0; + let text_margin = 20.0; + draw_text(&format!("Amplitude: {}, Freqency {}, X Offset {}", amp, freq, x_offset) , text_margin, text_h*1. +text_margin, text_h, WHITE); + draw_text(&format!("Cursor {:?}, Last Click {:?}", mouse_position(), (inital_x_pos, inital_y_pos)) , text_margin, text_h*2. +text_margin, text_h, WHITE); } // toggle debug box