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.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 src/ui.c (limited to 'src/ui.c') 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; +} -- cgit v1.2.3