GlistEngine
Loading...
Searching...
No Matches
gBitmapFont Class Reference

#include <gBitmapFont.h>

Public Member Functions

bool load (const std::string &fullPath)
bool loadImage (const std::string &imagePath)
bool loadFontImage (const std::string &imagePath)
void setCharacterList (const std::string &characters)
void setCharacters (const std::string &characters)
void setCharacterCoordinates (const std::vector< gRect > &coordinates)
bool setCharacters (const std::string &characters, const std::vector< gRect > &coordinates)
void drawText (const std::string &text, float x, float y)
void setScale (float scale)
float getScale () const
void setLetterSpacing (float spacing)
float getLetterSpacing () const
void setLineHeight (float height)
float getLineHeight () const
bool isLoaded () const
bool isConfigured () const
int getCharacterCount () const

Member Function Documentation

◆ drawText()

void gBitmapFont::drawText ( const std::string & text,
float x,
float y )

Draws UTF-8 text with x and y representing its top-left corner.

◆ getCharacterCount()

int gBitmapFont::getCharacterCount ( ) const

◆ getLetterSpacing()

float gBitmapFont::getLetterSpacing ( ) const

◆ getLineHeight()

float gBitmapFont::getLineHeight ( ) const

◆ getScale()

float gBitmapFont::getScale ( ) const

◆ isConfigured()

bool gBitmapFont::isConfigured ( ) const

◆ isLoaded()

bool gBitmapFont::isLoaded ( ) const

◆ load()

bool gBitmapFont::load ( const std::string & fullPath)

Loads a bitmap font image from an absolute or relative filesystem path.

◆ loadFontImage()

bool gBitmapFont::loadFontImage ( const std::string & imagePath)

◆ loadImage()

bool gBitmapFont::loadImage ( const std::string & imagePath)

Loads a bitmap font image from the application's assets/images folder.

◆ setCharacterCoordinates()

void gBitmapFont::setCharacterCoordinates ( const std::vector< gRect > & coordinates)

Sets glyph rectangles in bitmap pixel coordinates. gRect values use left, top, right and bottom edges.

◆ setCharacterList()

void gBitmapFont::setCharacterList ( const std::string & characters)

Sets the UTF-8 character list. Each code point is paired with the rectangle at the same index in the coordinate list.

◆ setCharacters() [1/2]

void gBitmapFont::setCharacters ( const std::string & characters)

◆ setCharacters() [2/2]

bool gBitmapFont::setCharacters ( const std::string & characters,
const std::vector< gRect > & coordinates )

Sets the character and coordinate lists together.

◆ setLetterSpacing()

void gBitmapFont::setLetterSpacing ( float spacing)

◆ setLineHeight()

void gBitmapFont::setLineHeight ( float height)

◆ setScale()

void gBitmapFont::setScale ( float scale)

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