aboutsummaryrefslogtreecommitdiffstats
path: root/src/ui.c
diff options
context:
space:
mode:
authornathansmith117 <thenathansmithsmith@gmail.com>2024-02-16 18:11:02 +0000
committernathansmith117 <thenathansmithsmith@gmail.com>2024-02-16 18:11:02 +0000
commit5d1e44f80cd2fc8ebfb56096d9b2e82dee3ce39f (patch)
treebe9b1e327c1c4063f06d67d996d57b8fd0795f8b /src/ui.c
parent2150113f50b5a51b74594310d12cca55b9886e14 (diff)
downloadPenguinYippies-5d1e44f80cd2fc8ebfb56096d9b2e82dee3ce39f.tar.gz
PenguinYippies-5d1e44f80cd2fc8ebfb56096d9b2e82dee3ce39f.tar.bz2
PenguinYippies-5d1e44f80cd2fc8ebfb56096d9b2e82dee3ce39f.zip
Working on textured button
Diffstat (limited to 'src/ui.c')
-rw-r--r--src/ui.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/ui.c b/src/ui.c
new file mode 100644
index 0000000..b1c00ce
--- /dev/null
+++ b/src/ui.c
@@ -0,0 +1,23 @@
+#include "ui.h"
+#include "game.h"
+
+TexturedButton createTexturedButton(Texture* texture, Rectangle rect, const char* message,
+ Color backgroundColor, Color foregroundColor)
+{
+ TexturedButton button;
+ button.texture = texture;
+ button.rect = rect;
+ strncpy((char*)button.message, message, UI_BUTTON_NAME_MAX);
+ button.backgroundColor = backgroundColor;
+ button.foregroundColor = foregroundColor;
+ button.isPressed = false;
+
+ return button;
+}
+
+bool updateTexturedButton(TexturedButton* button)
+{
+ // Draw the button.
+
+ return button->isPressed;
+}