aboutsummaryrefslogtreecommitdiffstats
path: root/src/ui.h
blob: 717435b422b3b63b1e4084fb3b96b137111f112a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
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