-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpanel.c
More file actions
62 lines (56 loc) · 979 Bytes
/
Copy pathpanel.c
File metadata and controls
62 lines (56 loc) · 979 Bytes
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#include "panel.h"
void panel_init(
UIPanel *panel,
const char *title)
{
panel->title = title;
}
void panel_layout(
UIPanel *panel,
UIContext *ui,
float x,
float y,
float w,
float h)
{
panel->rect =
ui_rect(
ui,
x,
y,
w,
h
);
}
void panel_draw(
UIPanel *panel,
UIContext *ui,
SDL_Renderer *renderer,
TTF_Font *font)
{
int radius =
(int)roundf(
28.0f * ui->scale
);
ui_glass(
renderer,
panel->rect,
radius,
false,
ui->dark
);
int padding =
(int)roundf(
25.0f * ui->scale
);
ui_text(
renderer,
font,
panel->title,
panel->rect.x + padding,
panel->rect.y + padding,
ui_theme(ui->dark,
(UIColor){35, 45, 62, 255},
(UIColor){180, 190, 210, 255}
));
}