public Element
{
public:
- Text(SGPropertyNode_ptr node);
- virtual ~Text();
-
- virtual void update(double dt);
+ Text(SGPropertyNode_ptr node, const Style& parent_style);
+ ~Text();
+ void setText(const char* text);
void setFont(const char* name);
-
void setAlignment(const char* align);
- const char* getAlignment() const;
protected:
- enum TextAttributes
- {
- FONT_SIZE = LAST_ATTRIBUTE << 1, // Font size and aspect ration
- };
-
- osg::ref_ptr<osgText::Text> _text;
-
- SGPropertyNode_ptr _font_size,
- _font_aspect;
+ class TextOSG;
+ osg::ref_ptr<TextOSG> _text;
virtual void childChanged(SGPropertyNode * child);
- virtual void colorChanged(const osg::Vec4& color);
- virtual void colorFillChanged(const osg::Vec4& color);
+
+ void handleHit(float x, float y);
typedef osg::ref_ptr<osgText::Font> font_ptr;
static font_ptr getFont(const std::string& name);