Slippers Engine
 
Loading...
Searching...
No Matches
FontManager Class Reference

Singleton responisble for loading and retrieving Fonts. More...

#include <FontManager.h>

Collaboration diagram for FontManager:
Collaboration graph

Static Public Member Functions

static void LoadFont (const MapKey &key, const std::string &path)
 Load Font with KEY and FILE PATH.
 
static SpriteFont * GetFont (const MapKey &key)
 Returns Font pointer with given KEY.
 

Private Types

using MapKey = std::string
 KEYS stored as STRINGS.
 

Detailed Description

Singleton responisble for loading and retrieving Fonts.

Member Typedef Documentation

◆ MapKey

using FontManager::MapKey = std::string
private

KEYS stored as STRINGS.

Member Function Documentation

◆ GetFont()

static SpriteFont * FontManager::GetFont ( const MapKey & key)
static

Returns Font pointer with given KEY.

A function that returns a Font pointer based on a user generated key. Checks if key already exists.

Parameters
key
Returns
Font*

◆ LoadFont()

static void FontManager::LoadFont ( const MapKey & key,
const std::string & path )
static

Load Font with KEY and FILE PATH.

A function callable in SlippersResources/LoadResources that takes in a String as a key for retrieval, as well as a file path for a font existing in Assets/Fonts. Checks for repeated key use.

Parameters
key
path