Wrath of Zeus
Made by Torchlight Games for CSE 125 SP24
Loading...
Searching...
No Matches
font.hpp
Go to the documentation of this file.
1#pragma once
2
3#include "client/core.hpp"
4
5#include <cstddef>
6#include <string>
7#include <unordered_map>
8
9namespace gui::font {
10
11
15enum class Font {
16 MENU,
17 TEXT,
18 TITLE,
19};
20
21#define ALL_FONTS() { \
22 Font::MENU, Font::TEXT, Font::TITLE \
23}
24
28std::string getFilepath(Font font);
29
33enum class Color {
34 BLACK,
35 RED,
36 GREEN,
37 BLUE,
38 GRAY,
39 WHITE,
40 YELLOW,
41};
42
46glm::vec3 getRGB(Color color);
47
48const int UNIT_LARGE_SIZE_PX = 128; // how many pixels a small font is on the unit screen size
49enum class Size {
50 SMALL,
52 MEDIUM,
53 LARGE,
54 XLARGE
55};
56const std::unordered_map<Size, float> SIZE_TO_SCALE = {
57 {Size::SMALL, 0.25f},
58 {Size::SMALLMEDIUM, 0.35f},
59 {Size::MEDIUM, 0.50f},
60 {Size::LARGE, 1.0f},
61 {Size::XLARGE, 2.0f},
62};
63
66
73float getRelativePixels(float pixels);
74
76
77}
GLint GLint GLsizei GLint GLenum GLenum const void * pixels
Definition: glad.h:1531
GLuint color
Definition: glad.h:2250
GLsizeiptr size
Definition: glad.h:1803
Definition: font.hpp:9
const std::unordered_map< Size, float > SIZE_TO_SCALE
Definition: font.hpp:56
const int UNIT_LARGE_SIZE_PX
Definition: font.hpp:48
int getFontSizePx(Size size)
Definition: font.cpp:10
float getScaleFactor(Size size)
Definition: font.cpp:14
glm::vec3 getRGB(Color color)
Definition: font.cpp:30
float getRelativePixelsHorizontal(float pixels)
Definition: font.cpp:56
Size
Definition: font.hpp:49
float getRelativePixels(float pixels)
Definition: font.cpp:51
Color
Definition: font.hpp:33
Font
Definition: font.hpp:15
std::string getFilepath(Font font)
Definition: font.cpp:20