Ketchup Engine
Loading...
Searching...
No Matches
SpriteFont Class Reference

#include <SpriteFont.h>

Collaboration diagram for SpriteFont:
Collaboration graph

Public Types

using Key = int
 
using Glyph = KSprite
 
using FontMap = std::map< Key, Glyph * >
 

Public Member Functions

 SpriteFont ()=delete
 
 SpriteFont (std::string name)
 
 ~SpriteFont ()
 
 SpriteFont (const SpriteFont &)=delete
 
SpriteFontoperator= (const SpriteFont &)=delete
 
GlyphGetGlyph (char c)
 Gets the Glyph for a given character in the font.
 

Private Member Functions

void XMLtoCollection (std::string filename)
 
void ElementTextToInt (IXmlReader *pReader, int &out)
 

Private Attributes

std::string m_name
 
Texture * p_tex
 
FontMap m_fontmap
 

Member Typedef Documentation

◆ FontMap

using SpriteFont::FontMap = std::map<Key, Glyph*>

◆ Glyph

◆ Key

using SpriteFont::Key = int

Constructor & Destructor Documentation

◆ SpriteFont() [1/3]

SpriteFont::SpriteFont ( )
delete

◆ SpriteFont() [2/3]

SpriteFont::SpriteFont ( std::string  name)

◆ ~SpriteFont()

SpriteFont::~SpriteFont ( )

◆ SpriteFont() [3/3]

SpriteFont::SpriteFont ( const SpriteFont )
delete

Member Function Documentation

◆ ElementTextToInt()

void SpriteFont::ElementTextToInt ( IXmlReader *  pReader,
int &  out 
)
private

◆ GetGlyph()

SpriteFont::Glyph * SpriteFont::GetGlyph ( char  c)

Gets the Glyph for a given character in the font.

Haru, 3/19/2023.

Parameters
cThe character.
Returns
A pointer to a KSprite Glyph for the character, nullptr for newlines, or a '@' Glyph if no corresponding Glyph exists.

◆ operator=()

SpriteFont & SpriteFont::operator= ( const SpriteFont )
delete

◆ XMLtoCollection()

void SpriteFont::XMLtoCollection ( std::string  filename)
private

Member Data Documentation

◆ m_fontmap

FontMap SpriteFont::m_fontmap
private

◆ m_name

std::string SpriteFont::m_name
private

◆ p_tex

Texture* SpriteFont::p_tex
private

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