-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgui.c
29 lines (24 loc) · 1.13 KB
/
gui.c
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
#include "gui.h"
void DrawShadowedText(const char *text, int x, int y, int font_size, Color color) {
DrawText(text, x+4, y+2, font_size, BLACK);
DrawText(text, x, y, font_size, color);
}
void DrawShadowedTextCenter(const char *text, int x, int y, int font_size, Color color) {
Vector2 text_dimens = MeasureTextEx(GetFontDefault(), text, font_size, 0);
x -= text_dimens.x / 2;
y -= text_dimens.y / 2;
DrawText(text, x+4, y+2, font_size, BLACK);
DrawText(text, x, y, font_size, color);
}
void DrawShadowedTextNE(const char *text, int x, int y, int font_size, Color color) {
Vector2 text_dimens = MeasureTextEx(GetFontDefault(), text, font_size, 0);
DrawShadowedText(text, x-text_dimens.x, y, font_size, color);
}
void DrawShadowedTextSE(const char *text, int x, int y, int font_size, Color color) {
Vector2 text_dimens = MeasureTextEx(GetFontDefault(), text, font_size, 0);
DrawShadowedText(text, x-text_dimens.x, y-text_dimens.y, font_size, color);
}
int DrawAndMeasureShadowedText(const char *text, int x, int y, int font_size, Color color) {
DrawShadowedText(text, x, y, font_size, color);
return MeasureText(text, font_size);
}