| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768 |
- $#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;
- const PODVector<int>& GetRowWidths() const;
- const PODVector<IntVector2>& GetCharPositions() const;
- const PODVector<IntVector2>& GetCharSizes() const;
-
- void SetEffectDepthBias(float bias);
- float GetEffectDepthBias() 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;
- };
|