| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263 |
- $#include "Text.h"
- enum TextEffect
- {
- TE_NONE = 0,
- TE_SHADOW,
- TE_STROKE
- };
- class Text : public UIElement
- {
- Text(Context* context);
- virtual ~Text();
- bool SetFont(const String fontName, int size = DEFAULT_FONT_SIZE);
- bool SetFont(Font* font, int size = DEFAULT_FONT_SIZE);
-
- void SetText(const String text);
-
- void SetTextAlignment(HorizontalAlignment align);
- void SetRowSpacing(float spacing);
- void SetWordwrap(bool enable);
- void SetSelection(unsigned start, unsigned length = M_MAX_UNSIGNED);
- void ClearSelection();
- void SetSelectionColor(const Color& color);
- void SetHoverColor(const Color& color);
- void SetTextEffect(TextEffect textEffect);
- void SetEffectColor(const Color& effectColor);
-
- Font* GetFont() const;
- int GetFontSize() const;
- const String& GetText() const;
- HorizontalAlignment GetTextAlignment() const;
- float GetRowSpacing() const;
- bool GetWordwrap() const;
- unsigned GetSelectionStart() const;
- unsigned GetSelectionLength() const;
- const Color& GetSelectionColor() const;
- const Color& GetHoverColor() const;
- TextEffect GetTextEffect() const;
- const Color& GetEffectColor() const;
- int GetRowHeight() const;
- unsigned GetNumRows() const;
-
- void SetFontAttr(ResourceRef value);
- ResourceRef GetFontAttr() const;
-
- tolua_property__get_set Font* font;
- tolua_readonly tolua_property__get_set int fontSize;
- tolua_property__get_set String& text;
- tolua_property__get_set HorizontalAlignment textAlignment;
- tolua_property__get_set float rowSpacing;
- tolua_property__get_set bool wordwrap;
- tolua_readonly tolua_property__get_set unsigned selectionStart;
- tolua_readonly tolua_property__get_set unsigned selectionLength;
- tolua_property__get_set Color& selectionColor;
- tolua_property__get_set Color& hoverColor;
- tolua_property__get_set TextEffect textEffect;
- tolua_property__get_set Color& effectColor;
- tolua_readonly tolua_property__get_set int rowHeight;
- tolua_readonly tolua_property__get_set unsigned numRows;
- tolua_property__get_set ResourceRef fontAttr;
- };
|