|
FifeGUI 0.3.0
A C++ GUI library designed for games.
|
#include <font.hpp>
Public Member Functions | |
| virtual void | drawString (Graphics *graphics, std::string const &text, int x, int y)=0 |
| Font (Font &&)=default | |
| Font (Font const &)=default | |
| virtual int | getHeight () const =0 |
| virtual int | getStringIndexAt (std::string const &text, int x) const |
| virtual int | getWidth (std::string const &text) const =0 |
| Font & | operator= (Font &&)=default |
| Font & | operator= (Font const &)=default |
| virtual | ~Font ()=default |
|
pure virtual |
Draws a string.
| graphics | A Graphics object to use for drawing. |
| text | The string to draw. |
| x | The x coordinate where to draw the string. |
| y | The y coordinate where to draw the string. |
Implemented in fcn::DefaultFont, fcn::ImageFont, and fcn::sdl3::TrueTypeFont.
References Font().
|
pure virtual |
Gets the height of the glyphs in the font.
Implemented in fcn::DefaultFont, fcn::ImageFont, and fcn::sdl3::TrueTypeFont.
References getStringIndexAt().
Referenced by fcn::DropDown::adjustHeight(), fcn::Button::adjustSizeImpl(), fcn::CheckBox::adjustSizeImpl(), fcn::Label::adjustSizeImpl(), fcn::Button::draw(), fcn::CheckBox::draw(), fcn::ImageButton::draw(), fcn::Label::draw(), fcn::MenuItem::draw(), fcn::Panel::draw(), fcn::Window::draw(), fcn::ListBox::getRowHeight(), and fcn::TextBox::keyPressed().
|
virtual |
Gets a string index in a string providing an x coordinate.
Used to retrieve a string index (for a character in a string) at a certain x position. It is especially useful when a mouse clicks in a TextField and you want to know which character was clicked.
Reimplemented in fcn::DefaultFont, and fcn::ImageFont.
Definition at line 17 of file font.cpp.
References getWidth().
Referenced by getHeight().
|
pure virtual |
Gets the width of a string.
The width of a string is not necessarily the sum of all the widths of its glyphs.
| text | The string to return the width of. |
Implemented in fcn::DefaultFont, fcn::ImageFont, and fcn::sdl3::TrueTypeFont.
Referenced by fcn::Button::adjustSizeImpl(), fcn::CheckBox::adjustSizeImpl(), fcn::MenuItem::draw(), and getStringIndexAt().