Skip to content

Commit

Permalink
moved text rendering to be above the grid
Browse files Browse the repository at this point in the history
  • Loading branch information
ArchUsr64 committed Nov 19, 2023
1 parent 993575d commit 795824f
Showing 1 changed file with 16 additions and 16 deletions.
32 changes: 16 additions & 16 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,22 +75,6 @@ async fn main() {
clear_background(BLACK);
let screen_size = (screen_width(), screen_height());
let min_screen_dimension = screen_size.0.min(screen_size.1);
draw_text(
format!("FPS: {:.0}", macroquad::time::get_fps(),).as_str(),
0.,
0.5 * min_screen_dimension * 0.1,
min_screen_dimension * 0.1,
WHITE,
);
if paused {
draw_text(
format!("PAUSED",).as_str(),
0.,
1.5 * min_screen_dimension * 0.1,
min_screen_dimension * 0.1,
WHITE,
);
}
let pixel_size = 0.95 * min_screen_dimension / 32.;
let gap = (
screen_size.0 - 32. * pixel_size,
Expand Down Expand Up @@ -123,6 +107,22 @@ async fn main() {
);
})
});
draw_text(
format!("FPS: {:.0}", macroquad::time::get_fps(),).as_str(),
0.,
0.5 * min_screen_dimension * 0.1,
min_screen_dimension * 0.1,
WHITE,
);
if paused {
draw_text(
format!("PAUSED",).as_str(),
0.,
1.5 * min_screen_dimension * 0.1,
min_screen_dimension * 0.1,
WHITE,
);
}
next_frame().await
}
}
Expand Down

0 comments on commit 795824f

Please sign in to comment.