Wrath of Zeus
Made by Torchlight Games for CSE 125 SP24
Loading...
Searching...
No Matches
Data Structures | Enumerations | Functions | Variables
gui::font Namespace Reference

Data Structures

struct  Character
 
class  Loader
 

Enumerations

enum class  Font { MENU , TEXT , TITLE }
 
enum class  Color {
  BLACK , RED , GREEN , BLUE ,
  GRAY , WHITE , YELLOW
}
 
enum class  Size {
  SMALL , SMALLMEDIUM , MEDIUM , LARGE ,
  XLARGE
}
 

Functions

std::string getFilepath (Font font)
 
glm::vec3 getRGB (Color color)
 
int getFontSizePx (Size size)
 
float getScaleFactor (Size size)
 
float getRelativePixels (float pixels)
 
float getRelativePixelsHorizontal (float pixels)
 

Variables

const int UNIT_LARGE_SIZE_PX = 128
 
const std::unordered_map< Size, float > SIZE_TO_SCALE
 

Enumeration Type Documentation

◆ Color

enum class gui::font::Color
strong

Preset colors for text

Enumerator
BLACK 
RED 
GREEN 
BLUE 
GRAY 
WHITE 
YELLOW 

◆ Font

enum class gui::font::Font
strong

Abstract representation of the different fonts to use in our game

Enumerator
MENU 
TEXT 
TITLE 

◆ Size

enum class gui::font::Size
strong
Enumerator
SMALL 
SMALLMEDIUM 
MEDIUM 
LARGE 
XLARGE 

Function Documentation

◆ getFilepath()

std::string gui::font::getFilepath ( Font  font)

Mappings from our specified abstract fonts to the file to load

◆ getFontSizePx()

int gui::font::getFontSizePx ( Size  size)

◆ getRelativePixels()

float gui::font::getRelativePixels ( float  pixels)

Takes an amount of pixels, and scales it to be from a 1500x1000 screen to the current screen width/height

Parameters
pixelsPixels on a 1500x1000 window
Returns
corresponding amount of pixels on the current window

◆ getRelativePixelsHorizontal()

float gui::font::getRelativePixelsHorizontal ( float  pixels)

◆ getRGB()

glm::vec3 gui::font::getRGB ( Color  color)

Mapping from preset font colors to RGB values

◆ getScaleFactor()

float gui::font::getScaleFactor ( Size  size)

Variable Documentation

◆ SIZE_TO_SCALE

const std::unordered_map<Size, float> gui::font::SIZE_TO_SCALE
Initial value:
= {
{Size::SMALL, 0.25f},
{Size::SMALLMEDIUM, 0.35f},
{Size::MEDIUM, 0.50f},
{Size::LARGE, 1.0f},
{Size::XLARGE, 2.0f},
}

◆ UNIT_LARGE_SIZE_PX

const int gui::font::UNIT_LARGE_SIZE_PX = 128