Class representing a text object. More...
#include <visdisplay.h>
Public Member Functions | |
Text (float x, float y, std::string text, fawkes::VisualDisplay2DInterface::Anchor anchor, float size, unsigned int id, unsigned int owner, unsigned char r=0, unsigned char g=0, unsigned char b=0, unsigned char a=0) | |
Constructor. | |
void | draw (Cairo::RefPtr< Cairo::Context > &cr) |
Draw shape to Cairo context. |
Class representing a text object.
Text is represented by a cartesian coordinate, which denotes a specific point defined by the anchor, the text itself, and a text size.
Definition at line 114 of file visdisplay.h.
VisualDisplay2D::Text::Text | ( | float | x, | |
float | y, | |||
std::string | text, | |||
fawkes::VisualDisplay2DInterface::Anchor | anchor, | |||
float | size, | |||
unsigned int | id, | |||
unsigned int | owner, | |||
unsigned char | r = 0 , |
|||
unsigned char | g = 0 , |
|||
unsigned char | b = 0 , |
|||
unsigned char | a = 0 | |||
) |
Constructor.
x | X coordinate of anchor point | |
y | Y coordinate of anchor point | |
text | text to display | |
anchor | anchor point relative to the text's bounding box | |
size | height of font in meters | |
id | object ID | |
owner | ID of the owner of the object | |
r | red part of RGBA color | |
g | green part of RGBA color | |
b | blue part of RGBA color | |
a | alpha part of RGBA color |
Definition at line 343 of file visdisplay.cpp.
void VisualDisplay2D::Text::draw | ( | Cairo::RefPtr< Cairo::Context > & | cr | ) | [virtual] |
Draw shape to Cairo context.
This method shall be implemented by a shape to draw itself using the provided Cairo context.
cr | reference to Cairo context. Note that this is a reference bypassing the reference pointer. This is done for efficiency and with the assumption that this method is only called by VisualDisplay2D::draw() which itself has proper refptr handling. |
Implements VisualDisplay2D::Shape.
Definition at line 360 of file visdisplay.cpp.