77 void setFontColor(
unsigned char red,
unsigned char green,
unsigned char blue,
78 unsigned char alpha = 255);
81 void pushFontColor(
unsigned char red,
unsigned char green,
unsigned char blue);
Contains jngl::Color class.
Contains jngl::Vec2 class.
Object representing a RGB color.
Font loaded from a TTF or OTF file.
void print(const std::string &, int x, int y)
Uses the font to print something at x y. The color can be specified using setFontColor.
void print(const std::string &text, Vec2 position) const
Draw text at position.
std::shared_ptr< FontImpl > getImpl()
Internal function.
Font(const std::string &filename, unsigned int size)
Creates a font from filename in size px.
void print(const std::string &text, jngl::Vec2 position)
Print text at position.
std::string getFont()
Returns the currently active font name.
int getLineHeight()
Get line height used py print() in pixel.
void setFontSize(int size)
Change the font size used by print()
void setFontColor(jngl::Color)
Sets the color of the currently active font.
int getFontSize()
Get the font size used by print()
void setFont(const std::string &filename)
Sets the currently active font to filename.
void pushFontColor(unsigned char red, unsigned char green, unsigned char blue)
Pushes the currently active font color on a stack and sets a new one.
void setLineHeight(int)
Set line height used by print() in pixel.
void popFontColor()
Resets the font color on the top of stack which is used by jngl::pushFontColor.
void setFontByName(const std::string &name)
Sets the currently active font by a font name.
double getTextWidth(const std::string &text)
Calculates the width of text in pixels if it would be drawn with the currently active font.