SUNENGINE 0.0.2
A simple and bright C++ game engine.
 
Loading...
Searching...
No Matches
SpriteFontManager Class Reference

Manages the loading and retrieval of SpriteFont objects. More...

#include <SpriteFontManager.h>

Static Public Member Functions

static SpriteFontGet (MapKey key)
 Retrieves a SpriteFont by key.
 
static void Load (MapKey key, std::string path)
 Loads a SpriteFont from a file.
 

Static Public Attributes

static const MapKey defaultSpriteFont = AssetDefaults::DefaultSpriteFontKey
 Default key for the default SpriteFont.
 

Private Member Functions

 SpriteFontManager (const SpriteFontManager &)=delete
 
SpriteFontManageroperator= (const SpriteFontManager &)=delete
 
SpriteFontprivGet (MapKey key)
 
void privLoad (MapKey key, std::string path)
 
void privDelete ()
 

Static Private Member Functions

static SpriteFontManagerInstance ()
 
static void Delete ()
 Deletes the singleton instance of the SpriteFontManager.
 

Private Attributes

const std::string defaultPath
 Default path for SpriteFont files.
 
std::map< MapKey, SpriteFont * > FontMap
 Map of keys to SpriteFont pointers.
 
const float defaultX = 0
 Default x-coordinate for SpriteFont glyphs.
 
const float defaultY = 0
 Default y-coordinate for SpriteFont glyphs.
 
const float defaultW = 1
 Default width for SpriteFont glyphs.
 
const float defaultH = 1
 Default height for SpriteFont glyphs.
 

Static Private Attributes

static SpriteFontManagerptrInstance = nullptr
 

Friends

class SpriteFontManagerAttorney
 

Detailed Description

Manages the loading and retrieval of SpriteFont objects.

The SpriteFontManager class is responsible for managing the loading and retrieval of SpriteFont objects. It provides methods to load SpriteFonts from files and retrieve them by key.

Member Function Documentation

◆ Get()

static SpriteFont * SpriteFontManager::Get ( MapKey key)
inlinestatic

Retrieves a SpriteFont by key.

Parameters
keyThe key associated with the SpriteFont.
Returns
Pointer to the SpriteFont associated with the key.
Here is the caller graph for this function:

◆ Load()

static void SpriteFontManager::Load ( MapKey key,
std::string path )
inlinestatic

Loads a SpriteFont from a file.

Parameters
keyThe key to associate with the SpriteFont.
pathThe path to the file containing the SpriteFont data.

The documentation for this class was generated from the following files: