Bare Metal Programming Tool Kit
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Pages
Public Member Functions | Public Attributes | List of all members
bmptk::graphics::text Class Reference

a formatted text More...

#include <graphics.h>

Inheritance diagram for bmptk::graphics::text:
bmptk::graphics::image

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
 

Detailed Description

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.

Constructor & Destructor Documentation

bmptk::graphics::text::text ( const char *  s,
const format  f = format() 
)
inline

instantiate a text object

Parameters
spointer 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
fthe 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.

Member Function Documentation

void bmptk::graphics::text::draw ( frame f,
const vector  position = vector::origin() 
) const
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.


The documentation for this class was generated from the following file: