#include <glText.h>
This class, called GlText, allows to render text in OpenGL, always facing the camera in 2D (screen) or in 3D (world coordinates)
Public Member Functions | |
| GlText () | |
| Constructor. More... | |
| GlText (const std::string &text) | |
| Constructor with specified text. More... | |
| GlText (const std::string &text, const type::Vec3 &position) | |
| Constructor with specified text and position. More... | |
| GlText (const std::string &text, const type::Vec3 &position, const double &scale) | |
| Constructor with specified text, position and scale. More... | |
| ~GlText () | |
| Destructor. More... | |
| void | setText (const std::string &text) |
| Update the text to render. More... | |
| template<typename T > | |
| void | setText (const T &text) |
| Update the text to render. More... | |
| void | update (const type::Vec3 &position) |
| Update the position used to render the text. More... | |
| void | update (const double &scale) |
| Update the scale used to render the text. More... | |
| void | draw () |
| Render the text at the defined position and scale. More... | |
Static Public Member Functions | |
| template<typename T > | |
| static void | draw (const T &text, const type::Vec3 &position=type::Vec3(0.0, 0.0, 0.0), const double &scale=1.0) |
| Render the text at the defined position and scale. More... | |
| static void | textureDraw_Overlay (const char *text, const double scale=1.0) |
| static void | textureDraw_Indices (const type::vector< type::Vec3 > &positions, const float &scale) |
| sofa::gl::GlText::GlText | ( | ) |
Constructor.
| sofa::gl::GlText::GlText | ( | const std::string & | text | ) |
Constructor with specified text.
| sofa::gl::GlText::GlText | ( | const std::string & | text, |
| const type::Vec3 & | position | ||
| ) |
Constructor with specified text and position.
| sofa::gl::GlText::GlText | ( | const std::string & | text, |
| const type::Vec3 & | position, | ||
| const double & | scale | ||
| ) |
Constructor with specified text, position and scale.
| sofa::gl::GlText::~GlText | ( | ) |
Destructor.
| void sofa::gl::GlText::draw | ( | ) |
Render the text at the defined position and scale.
|
static |
Render the text at the defined position and scale.
| void sofa::gl::GlText::setText | ( | const std::string & | text | ) |
Update the text to render.
| void sofa::gl::GlText::setText | ( | const T & | text | ) |
Update the text to render.
|
static |
|
static |
| void sofa::gl::GlText::update | ( | const double & | scale | ) |
Update the scale used to render the text.
| void sofa::gl::GlText::update | ( | const type::Vec3 & | position | ) |
Update the position used to render the text.