diff options
| author | Xavier Del Campo Romero <xavi.dcr@tutanota.com> | 2022-06-11 23:22:04 +0200 |
|---|---|---|
| committer | Xavier Del Campo Romero <xavi.dcr@tutanota.com> | 2022-06-11 23:42:27 +0200 |
| commit | 6f74cbd20b1fe0ef9f2a55057e9ac066bec0b575 (patch) | |
| tree | bd6e709305fa93c216915ad73662517b74754489 /src/button/inc | |
| parent | 46fec13fcbee1385db0927f1162f60e1f328d63c (diff) | |
| download | jancity-6f74cbd20b1fe0ef9f2a55057e9ac066bec0b575.tar.gz | |
Implement button component
Diffstat (limited to 'src/button/inc')
| -rw-r--r-- | src/button/inc/button.h | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/src/button/inc/button.h b/src/button/inc/button.h new file mode 100644 index 0000000..062cb07 --- /dev/null +++ b/src/button/inc/button.h @@ -0,0 +1,36 @@ +#ifndef BUTTON_H +#define BUTTON_H + +#include <gfx.h> +#include <stdbool.h> + +#ifdef __cplusplus +extern "C" +{ +#endif + +enum +{ + BUTTON_LEFT, + BUTTON_MID, + BUTTON_RIGHT, + + MAX_BUTTON_SPRITES +}; + +struct button +{ + const char *text; + short x, y, w; +}; + +bool button_is_pressed(const struct button *b); +int button_render(const struct button *b); + +extern struct sprite button_sprites[MAX_BUTTON_SPRITES]; + +#ifdef __cplusplus +} +#endif + +#endif /* BUTTON_H */ |
