summaryrefslogtreecommitdiff
path: root/ui.h
blob: 6a36566d12436029c5e806b306830c9a19dba1d0 (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
30
31
32
33
34
35
36
37
38
39
40
41
#ifndef ui_h
#define ui_h

#include "render.h"
#include "rect.h"

typedef struct {
	Font* font;
} UI;

Rectangle rectcut_left  (Rectangle* l, int a);
Rectangle rectcut_right (Rectangle* l, int a);
Rectangle rectcut_top   (Rectangle* l, int a);
Rectangle rectcut_bottom(Rectangle* l, int a);
Rectangle shrink_rect   (const Rectangle* l, int a);
Rectangle centre_rect   (
	const Rectangle* l,
	const Rectangle* t
);

void init_ui(UI* u, Font* f);
void ui_begin(UI* u, Rectangle* l);
void ui_end(UI* u);
int ui_button(
	UI* u,
	const Rectangle* l,
	const char* label
);
void ui_label(
	UI* u,
	const Rectangle* l,
	const char* text
);
void ui_container(
	UI* u,
	const Rectangle* l,
	Rectangle* r,
	const Rectangle* c
);

#endif