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
|
#include "resources.h"
#include <stddef.h>
#include <raylib.h>
Font MainFont;
Font MonoFont;
void LoadResources() {
MainFont = LoadFontEx("assets/fonts/coolvetica.ttf", 100, NULL, 0);
MonoFont = LoadFontEx("assets/fonts/monofont.ttf", 100, NULL, 0);
}
Font *GetMainFont() { return &MainFont; }
Font *GetMonoFont() { return &MonoFont; }
void DrawStripe(int start_step, int end_step, Color color) {
int height = GetScreenHeight();
Vector2 p1 = { .x = start_step, .y = 0 },
p2 = { .x = end_step, .y = height },
p3 = { .x = start_step, .y = height };
DrawTriangle(p1, p2, p3, color);
p2 = p3;
p3 = p1;
p3.x += (start_step - end_step);
DrawTriangle(p1, p2, p3, color);
}
void DrawBackground() {
ClearBackground(COLORSCHEME_WHITE);
double step = GetScreenWidth() / 6.0f;
DrawStripe(step * 2, step, COLORSCHEME_YELLOW);
DrawStripe(step * 3 - 1, step * 2 - 1, COLORSCHEME_ORANGE);
DrawStripe(step * 4 - 2, step * 3 - 2, COLORSCHEME_RED);
DrawStripe(step * 5 - 3, step * 4 - 3, COLORSCHEME_BROWN);
DrawRectangle(step * 5 - 3, 0,
step * 2, GetScreenHeight(),
COLORSCHEME_BROWN);
}
|