From ea7cd94f7aeb177618db3907a6c86b7252e018f0 Mon Sep 17 00:00:00 2001 From: quou Date: Sat, 1 Jun 2024 12:19:16 +1000 Subject: Initial commit. --- ui.h | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 ui.h (limited to 'ui.h') diff --git a/ui.h b/ui.h new file mode 100644 index 0000000..6a36566 --- /dev/null +++ b/ui.h @@ -0,0 +1,41 @@ +#ifndef ui_h +#define ui_h + +#include "render.h" +#include "rect.h" + +typedef struct { + Font* font; +} UI; + +Rectangle rectcut_left (Rectangle* l, int a); +Rectangle rectcut_right (Rectangle* l, int a); +Rectangle rectcut_top (Rectangle* l, int a); +Rectangle rectcut_bottom(Rectangle* l, int a); +Rectangle shrink_rect (const Rectangle* l, int a); +Rectangle centre_rect ( + const Rectangle* l, + const Rectangle* t +); + +void init_ui(UI* u, Font* f); +void ui_begin(UI* u, Rectangle* l); +void ui_end(UI* u); +int ui_button( + UI* u, + const Rectangle* l, + const char* label +); +void ui_label( + UI* u, + const Rectangle* l, + const char* text +); +void ui_container( + UI* u, + const Rectangle* l, + Rectangle* r, + const Rectangle* c +); + +#endif -- cgit v1.2.3-54-g00ecf