diff options
| author | physick <mynameisgennadiy@vk.com> | 2026-07-31 18:36:22 +0500 |
|---|---|---|
| committer | physick <mynameisgennadiy@vk.com> | 2026-07-31 18:36:22 +0500 |
| commit | 722a9d1e729aff2eb64f3c064c33d547ea980eb0 (patch) | |
| tree | fb03a4f5bf76d1274565ef261e7f2e3a579a0823 /src/ui_elements/UI.h | |
| parent | e20b4c3a5dfe081fa2d6d772617307fae4689698 (diff) | |
Buttons GUI start
Diffstat (limited to 'src/ui_elements/UI.h')
| -rw-r--r-- | src/ui_elements/UI.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/ui_elements/UI.h b/src/ui_elements/UI.h index 06d127f..c23faf7 100644 --- a/src/ui_elements/UI.h +++ b/src/ui_elements/UI.h @@ -1,5 +1,6 @@ #include <raylib.h> #include <stddef.h> +#include "../scenes/scenes.h" #ifndef UI_ELEMENTS_H #define UI_ELEMENTS_H @@ -17,6 +18,18 @@ void DrawTextInRec(Rectangle rec, char *text, Font *font, int height, Color colo float MeasureChar(Font *font, int height, char symbol); bool IsMouseInRec(Rectangle rec); +// ========== BUTTON ========== + +typedef struct { + Scene *parent; + void (*OnClick)(Scene *); + Texture *atlas; + Rectangle textrueLocation; +} Button; + +void UpdateButton(Button *btn, Rectangle *location); +void DrawButton(Button *btn, Rectangle *location); + // ========== TEXT EDITOR ========== static const size_t DEFAULT_TEXT_NODE_SIZE = 256; |
