Bare Metal Programming Tool Kit
|
a formatted text More...
#include <graphics.h>
Public Member Functions | |
text (const char *s, const format f=format()) | |
instantiate a text object | |
void | draw (frame &f, const vector position=vector::origin()) const |
draw the text on f, at position | |
Public Member Functions inherited from bmptk::graphics::image | |
image () | |
default constructor | |
Public Attributes | |
const char * | s |
the ASCII text string; can be changed | |
format | f |
the format used to draw the text; can be changed | |
a formatted text
This class is used to draw a formatted text in a frame. A format object contains a copy of its format, and a pointer to its text string. Hence the character string is not copied, so it must still be available when the text object is drawn.
Definition at line 1967 of file graphics.h.
instantiate a text object
s | pointer to the 0-terminated character string This string is not copied, only the address is stored. You can change the content of the string, or even the pointer (the s attribute), as you see fit. Note: the string must still be availabe when the text is drawn |
f | the format used to draw the text This format is copied. You can change the copy (the f attribute) as you see fit. |
Definition at line 1977 of file graphics.h.
|
virtual |
draw the text on f, at position
The text is drawn according to the current format (the f attribute), and the text that is drawn is the current string (whatever the s attribute points to).
Implements bmptk::graphics::image.