From bb4e23344b03c4f0947852530e13885035a6c3fb Mon Sep 17 00:00:00 2001 From: Tim Redfern Date: Wed, 4 Sep 2013 10:12:20 +0100 Subject: switch to h264 codec --- rotord/src/nodes_drawing.h | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) (limited to 'rotord/src/nodes_drawing.h') 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 &settings) { + Text(map &settings):Text() { base_settings(settings); }; - ~Hello_draw(){}; - Hello_draw* clone(map &_settings) { return new Hello_draw(_settings);}; + ~Text(){}; + Text* clone(map &_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: -- cgit v1.2.3