13 Creates an object consisting of the visual representation of a string. Can be
14 used with an ObjectInstance to further customize the appearance.
16 class Text: public Renderable
44 Text(const Font &, const Technique * = 0);
46 const Mesh *get_mesh() const { return &mesh; }
48 /** Sets technique to render with. It should have a texture slot named
49 "diffuse_map", which will be replaced with the font's texture. */
50 void set_technique(const Technique *);
52 const Technique *get_technique() const { return object.get_technique(); }
54 /// Sets the string to be displayed.
55 void set_text(const std::string &, StringCodec::Decoder &);
58 void set_text(const std::string &t)
60 typename C::Decoder dec;
64 void set_text(const std::string &t)
65 { set_text<StringCodec::Utf8>(t); }
67 /// Clears the object's contents.
70 /// Sets horizontal and vertical alignment with predefined anchors.
71 void set_alignment(HorizontalAlign, VerticalAlign = BASELINE);
73 /** Sets horizontal and vertical alignment. 0.0 means left or baseline,
74 1.0 means right or top. */
75 void set_alignment(float, float = 0.0f);
77 float get_width() const { return width; }
79 virtual void render(Renderer &, const Tag & = Tag()) const;
81 operator const Object &() const { return object; }