ContRap-Libraries
|
Class Text2D represents a line of text. More...
#include <primitives.h>
Public Types | |
enum | Alignment { LEFT, CENTER, RIGHT } |
Text alignment. More... | |
Public Member Functions | |
Text2D (double x=0.0, double y=0.0, const std::string &text="") | |
Creates a new text. | |
virtual | ~Text2D () |
Destructor. | |
Text2D (const Text2D &primitive) | |
Copy constructor. | |
Text2D & | operator= (const Text2D &primitive) |
Assignment operator. | |
virtual Type | get_type () const |
Type of the primitive. | |
void | set_alignment (Alignment alignment) |
Sets the text alignment. | |
Alignment | get_alignment () |
Returns the alignment. | |
virtual Primitive2D * | get_copy () |
Copies the current primitive. | |
Protected Attributes | |
Alignment | alignment |
Text alignment. |
Class Text2D represents a line of text.
crp::Text2D::Text2D | ( | double | x = 0.0 , |
double | y = 0.0 , |
||
const std::string & | text = "" |
||
) | [inline] |
Creates a new text.
x | X-Coordinate |
y | Y-Coordinate |
text | Text to display |
virtual crp::Text2D::~Text2D | ( | ) | [inline, virtual] |
Destructor.
crp::Text2D::Text2D | ( | const Text2D & | primitive | ) | [inline] |
Copy constructor.
primitive | Primitive to copy |
Alignment crp::Text2D::get_alignment | ( | ) | [inline] |
Returns the alignment.
virtual Primitive2D* crp::Text2D::get_copy | ( | ) | [inline, virtual] |
Copies the current primitive.
Implements crp::Primitive2D.
virtual Type crp::Text2D::get_type | ( | ) | const [inline, virtual] |
Assignment operator.
primitive | Object to assign |
void crp::Text2D::set_alignment | ( | Alignment | alignment | ) | [inline] |
Sets the text alignment.
alignment | New alignment |
Alignment crp::Text2D::alignment [protected] |
Text alignment.