summaryrefslogtreecommitdiff
path: root/lib/button.hpp
diff options
context:
space:
mode:
authorRitabrata Das <[email protected]>2026-09-09 21:07:21 +0530
committerRitabrata Das <[email protected]>2026-09-09 21:07:21 +0530
commitffd968a26826108ca9fb23d46ed5789260852eb7 (patch)
tree3861d08dae1c28f547952dbcc16e04ae7b5286b5 /lib/button.hpp
intial commit
Diffstat (limited to 'lib/button.hpp')
-rw-r--r--lib/button.hpp32
1 files changed, 32 insertions, 0 deletions
diff --git a/lib/button.hpp b/lib/button.hpp
new file mode 100644
index 0000000..8459cdc
--- /dev/null
+++ b/lib/button.hpp
@@ -0,0 +1,32 @@
+#pragma once
+
+#include <functional>
+
+#include "raylib.h"
+
+namespace ui {
+
+using ButtonCallback = std::function<void()>;
+
+void Init();
+void Shutdown();
+
+void DrawText(const char* text, int pos_x, int pos_y, int font_size,
+ Color color);
+
+void DrawTextV(const char* text, Vector2 position, int font_size,
+ Color color);
+
+void DrawTextVClickable(const char* text, Vector2 position, int font_size,
+ const ButtonCallback& on_click, Vector2 mousePos);
+
+void DrawTextRotationV(const char* text, Vector2 position, int font_size, float rotInDeg, Color color);
+
+void DrawButton(float x, float y, float width, float height, const char* text,
+ int font_size, const ButtonCallback& on_click, Vector2 mousePos);
+
+void DrawButtonNoHover(float x, float y, float width, float height, const char* text,
+ int font_size, const ButtonCallback& on_click, Vector2 mousePos, Color fillColor = RAYWHITE);
+
+Font GetActiveFont();
+} // namespace ui