|
| short | color [4] = {0, 0, 0, 255} |
| |
| SlFont::SlFont |
( |
std::string |
name | ) |
|
Constructor, makes sure each SlFont has a name.
Default destructor. Calls TTF_CloseFont.
| TTF_Font* SlFont::font |
( |
| ) |
|
|
inline |
Direct access to the TTF_Font.
| void SlFont::loadFont |
( |
std::string |
fontfile, |
|
|
int |
fontsize |
|
) |
| |
Loads font from fontfile. Hangs on to the font until destructor is called.
- Exceptions
-
| std::runtime_error | if font can't be loaded. |
| std::string SlFont::name |
( |
| ) |
|
|
inline |
The object name cannot be changed after instantiation.
| SDL_Color SlFont::sdlcolor |
( |
| ) |
|
Returns the colour as a SDL_Color struct
| void SlFont::setAlpha |
( |
uint8_t |
alpha | ) |
|
Set alpha, leaving colours unchanged.
| void SlFont::setColor |
( |
uint8_t |
red, |
|
|
uint8_t |
green, |
|
|
uint8_t |
blue, |
|
|
uint8_t |
alpha |
|
) |
| |
Set colours and alpha directly without needing to create an array.
| void SlFont::setColor |
( |
uint8_t |
red, |
|
|
uint8_t |
green, |
|
|
uint8_t |
blue |
|
) |
| |
Set colours directly without needing to create an array. Leaves alpha unchanged.
| short SlFont::color[4] = {0, 0, 0, 255} |
The colour the font will be rendered when creating the texture. (This is not the same as the color mod and alpha mod that may be applied when the resulting SlSprite is rendered.)
The actual font. To improve perfomance, the object will keep the font until the destructor is called.
| std::string SlFont::name_ |
|
private |
The object name cannot be changed after instantiation.
The documentation for this class was generated from the following files: