summaryrefslogtreecommitdiff
path: root/rotord/src/nodes_drawing.h
diff options
context:
space:
mode:
Diffstat (limited to 'rotord/src/nodes_drawing.h')
-rw-r--r--rotord/src/nodes_drawing.h22
1 files changed, 12 insertions, 10 deletions
diff --git a/rotord/src/nodes_drawing.h b/rotord/src/nodes_drawing.h
index 497fa25..d91ad87 100644
--- a/rotord/src/nodes_drawing.h
+++ b/rotord/src/nodes_drawing.h
@@ -41,25 +41,27 @@ namespace Rotor {
}
private:
};
- class Hello_draw: public Draw_node {
+ class Text: public Draw_node {
public:
- Hello_draw(){
- //no title or description as it isn't intended for the user
+ Text(){
+ title="Text";
+ description="Draws text";
+ create_attribute("text","Text to draw","Text","hello, world!");
};
- Hello_draw(map<string,string> &settings) {
+ Text(map<string,string> &settings):Text() {
base_settings(settings);
};
- ~Hello_draw(){};
- Hello_draw* clone(map<string,string> &_settings) { return new Hello_draw(_settings);};
+ ~Text(){};
+ Text* clone(map<string,string> &_settings) { return new Text(_settings);};
void vector_output(cairo_t * cr,const Frame_spec &frame){
cairo_text_extents_t te;
- cairo_set_source_rgb (cr, 1.0, 0.0, 0.0);
+ cairo_set_source_rgb (cr, 1.0, 1.0, 1.0);
cairo_select_font_face (cr, "Georgia",
CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_BOLD);
- cairo_set_font_size (cr, 50);
- cairo_text_extents(cr, "hello, world!", &te);
+ cairo_set_font_size (cr, 250);
+ cairo_text_extents(cr, attributes["text"]->value.c_str(), &te);
cairo_move_to (cr,(frame.w-te.width)/2,(frame.h-te.height)/2);
- cairo_show_text (cr, "hello, world!");
+ cairo_show_text (cr, attributes["text"]->value.c_str());
cairo_fill(cr);
}
private: