From 6a40a596c185637945a3f16831b66ba2dad34551 Mon Sep 17 00:00:00 2001 From: Rockingcool Date: Mon, 11 Mar 2024 13:18:48 -0500 Subject: [PATCH] Added new function to display text then exit --- raygui_helpers.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/raygui_helpers.cpp b/raygui_helpers.cpp index 88dbfe2..886e7bb 100644 --- a/raygui_helpers.cpp +++ b/raygui_helpers.cpp @@ -1,6 +1,6 @@ #include "includes/raygui_helpers.hpp" #include "includes/raygui/raygui.h" - +#include "includes/timer.h" void display_text_centered(std::string to_disp) { const char* to_disp_cstr = to_disp.c_str(); Vector2 label_size = MeasureTextEx(GetFontDefault(), to_disp_cstr, GuiGetStyle(DEFAULT, TEXT_SIZE)+1, GuiGetStyle(DEFAULT, TEXT_SPACING)+1); // The '+1' is there to account for any rounding errors @@ -11,3 +11,10 @@ void display_text_centered(std::string to_disp) { EndDrawing(); return; } + +void display_and_exit(std::string to_disp, int time) { + display_text_centered(to_disp); + Timer timer = timer_init(time); + while (!timer_done(timer)); + return; +}