|
Untitled Game engine no.5
1.0
|
Data structure for storing font texture data. Doubles as a library for loading fonts into memory. More...
#include <Font.hpp>
Public Member Functions | |
| Font (const char *path) | |
| Load a font object from a system path. | |
| void | renderText (const std::string &text, Ref< MeshRenderer > &meshRenderer, Allignment alignment=CENTER, float z=0) |
| Renders texture data from a string and applies it to a MeshRenderer. More... | |
| void | renderText (const std::string &text, MeshRenderer *meshRenderer, Allignment alignment=CENTER, float z=0) |
Static Public Member Functions | |
| static void | InitFont () |
| Initialize global font data. | |
| static void | FinalizeFonts () |
| Delete any font loader data, not font texture data. | |
Public Attributes | |
| std::vector< Ref< Glyph > > | glyphs |
| lookup table from a ascii character code to graphical data | |
| bool | singleTex = true |
| is there one texture for all of the characters? | |
Static Public Attributes | |
| static uint | GLYPH_COUNT = 256 |
| Number of required glyphs. | |
| static FT_Library | FT = nullptr |
| link to the Freetype font library | |
Data structure for storing font texture data. Doubles as a library for loading fonts into memory.
| void Engine::Font::renderText | ( | const std::string & | text, |
| Ref< MeshRenderer > & | meshRenderer, | ||
| Allignment | alignment = CENTER, |
||
| float | z = 0 |
||
| ) |
Renders texture data from a string and applies it to a MeshRenderer.
| text | text to render |
| meshRenderer | renderer reference |
| alignment | Text alignment (experimental) |
| z | z layer for the text (helpful for rendering text on top of other UI elements at z layer 0) |
1.8.17