summaryrefslogtreecommitdiff
path: root/lib/button.hpp
blob: 8459cdcb53ae5c6f49735629489052133b3a2f40 (plain)
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
30
31
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