diff options
| author | Tim Redfern <tim@eclectronics.org> | 2013-09-04 10:12:20 +0100 |
|---|---|---|
| committer | Tim Redfern <tim@eclectronics.org> | 2013-09-04 10:12:20 +0100 |
| commit | bb4e23344b03c4f0947852530e13885035a6c3fb (patch) | |
| tree | 4c7f4dad1ace3e5526ba64bc609c33c5fb445366 /rotord/src/nodes_drawing.h | |
| parent | e758be24228dfda9e3d0d4257dca81b4ec5a71b2 (diff) | |
switch to h264 codec
Diffstat (limited to 'rotord/src/nodes_drawing.h')
| -rw-r--r-- | rotord/src/nodes_drawing.h | 22 |
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: |
