aboutsummaryrefslogtreecommitdiffstats
path: root/src/ui.h
blob: 7d487d5758b7ecdd8975fc267a718f06e93a1b04 (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
26
27
28
29
#include "gameCommon.h"

#define UI_BUTTON_NAME_MAX 50
#define UI_BUTTON_DEFAULT_FONT_SIZE 20

#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];
    size_t messageLength;

    Color backgroundColor;
    Color foregroundColor;

    int fontSize;

    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