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, const std::string & = std::string());
46 const Mesh *get_mesh() const { return &mesh; }
48 /** Sets technique to render with, replacing the given texture slot with
49 the font texture. If no texture slot is specified, heuristics are used to
50 choose a suitable one. */
51 void set_technique(const Technique *, const std::string & = std::string());
53 const Technique *get_technique() const { return object.get_technique(); }
55 /// Sets the string to be displayed.
56 void set_text(const std::string &, StringCodec::Decoder &);
59 void set_text(const std::string &t)
61 typename C::Decoder dec;
65 void set_text(const std::string &t)
66 { set_text<StringCodec::Utf8>(t); }
68 /// Clears the object's contents.
71 /// Sets horizontal and vertical alignment with predefined anchors.
72 void set_alignment(HorizontalAlign, VerticalAlign = BASELINE);
74 /** Sets horizontal and vertical alignment. 0.0 means left or baseline,
75 1.0 means right or top. */
76 void set_alignment(float, float = 0.0f);
78 float get_width() const { return width; }
80 virtual void render(Renderer &, Tag = Tag()) const;
82 operator const Object &() const { return object; }