From 5d1e44f80cd2fc8ebfb56096d9b2e82dee3ce39f Mon Sep 17 00:00:00 2001 From: nathansmith117 Date: Fri, 16 Feb 2024 11:11:02 -0700 Subject: Working on textured button --- src/ui.h | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 src/ui.h (limited to 'src/ui.h') diff --git a/src/ui.h b/src/ui.h new file mode 100644 index 0000000..717435b --- /dev/null +++ b/src/ui.h @@ -0,0 +1,25 @@ +#include "gameCommon.h" + +#define UI_BUTTON_NAME_MAX 50 + +#ifndef UI_H +#define UI_H + +typedef struct TexturedButton { + Texture* texture; // Can be in a animation or assets. + Rectangle rect; + + char message[UI_BUTTON_NAME_MAX]; + + Color backgroundColor; + Color foregroundColor; + + bool isPressed; +} TexturedButton; + +// Buttons don't need to be freed from memory. The button doesn't handle the texture memory. +TexturedButton createTexturedButton(Texture* texture, Rectangle rect, const char* message, + Color backgroundColor, Color foregroundColor); +bool updateTexturedButton(TexturedButton* button); + +#endif -- cgit v1.2.3