Browse Source

Text effect attributes accessible from Lua

Bengt Soderstrom 9 years ago
parent
commit
bcbaf08026
2 changed files with 32 additions and 14 deletions
  1. 16 7
      Source/Urho3D/LuaScript/pkgs/UI/Text.pkg
  2. 16 7
      Source/Urho3D/LuaScript/pkgs/UI/Text3D.pkg

+ 16 - 7
Source/Urho3D/LuaScript/pkgs/UI/Text.pkg

@@ -14,9 +14,9 @@ class Text : public UIElement
 
     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);
@@ -25,11 +25,14 @@ class Text : public UIElement
     void SetSelectionColor(const Color& color);
     void SetHoverColor(const Color& color);
     void SetTextEffect(TextEffect textEffect);
+    void SetEffectShadowOffset(IntVector2 offset);
+    void SetEffectStrokeThickness(int thickness);
+    void SetEffectRoundStroke(bool roundStroke);
     void SetEffectColor(const Color& effectColor);
-    
+
     bool GetAutoLocalizable() const;
     void SetAutoLocalizable(bool enable);
-    
+
     Font* GetFont() const;
     int GetFontSize() const;
     const String GetText() const;
@@ -41,6 +44,9 @@ class Text : public UIElement
     const Color& GetSelectionColor() const;
     const Color& GetHoverColor() const;
     TextEffect GetTextEffect() const;
+    IntVector2 GetEffectShadowOffset() const;
+    int GetEffectStrokeThickness() const;
+    bool GetEffectRoundStroke() const;
     const Color& GetEffectColor() const;
     int GetRowHeight() const;
     unsigned GetNumRows() const;
@@ -48,10 +54,10 @@ class Text : public UIElement
     int GetRowWidth(unsigned index) const;
     IntVector2 GetCharPosition(unsigned index);
     IntVector2 GetCharSize(unsigned index);
-    
+
     void SetEffectDepthBias(float bias);
     float GetEffectDepthBias() const;
-    
+
     tolua_property__get_set Font* font;
     tolua_readonly tolua_property__get_set int fontSize;
     tolua_property__get_set String text;
@@ -64,6 +70,9 @@ class Text : public UIElement
     tolua_property__get_set Color& selectionColor;
     tolua_property__get_set Color& hoverColor;
     tolua_property__get_set TextEffect textEffect;
+    tolua_property__get_set IntVector2 effectShadowOffset;
+    tolua_property__get_set int effectStrokeThickness;
+    tolua_property__get_set bool effectRoundStroke;
     tolua_property__get_set Color& effectColor;
     tolua_readonly tolua_property__get_set int rowHeight;
     tolua_readonly tolua_property__get_set unsigned numRows;
@@ -82,4 +91,4 @@ static int tolua_UILuaAPI_Text_new00_local(lua_State* tolua_S)
 {
     return ToluaNewObjectGC<Text>(tolua_S);
 }
-$}
+$}

+ 16 - 7
Source/Urho3D/LuaScript/pkgs/UI/Text3D.pkg

@@ -14,14 +14,14 @@ class Text3D : public Drawable
 {
     Text3D();
     ~Text3D();
-    
+
     bool SetFont(const String fontName, int size = DEFAULT_FONT_SIZE);
     bool SetFont(Font* font, int size = DEFAULT_FONT_SIZE);
-    
+
     void SetMaterial(Material* material);
-    
+
     void SetText(const String text);
-    
+
     void SetAlignment(HorizontalAlignment hAlign, VerticalAlignment vAlign);
     void SetHorizontalAlignment(HorizontalAlignment align);
     void SetVerticalAlignment(VerticalAlignment align);
@@ -29,6 +29,9 @@ class Text3D : public Drawable
     void SetRowSpacing(float spacing);
     void SetWordwrap(bool enable);
     void SetTextEffect(TextEffect textEffect);
+    void SetEffectShadowOffset(IntVector2 offset);
+    void SetEffectStrokeThickness(int thickness);
+    void SetEffectRoundStroke(bool roundStroke);
     void SetEffectColor(const Color& effectColor);
     void SetEffectDepthBias(float bias);
     void SetWidth(int width);
@@ -36,7 +39,7 @@ class Text3D : public Drawable
     void SetColor(Corner corner, const Color& color);
     void SetOpacity(float opacity);
     void SetFaceCameraMode(FaceCameraMode mode);
-    
+
     Font* GetFont() const;
     Material* GetMaterial() const;
     int GetFontSize() const;
@@ -47,6 +50,9 @@ class Text3D : public Drawable
     float GetRowSpacing() const;
     bool GetWordwrap() const;
     TextEffect GetTextEffect() const;
+    IntVector2 GetEffectShadowOffset() const;
+    int GetEffectStrokeThickness() const;
+    bool GetEffectRoundStroke() const;
     const Color& GetEffectColor() const;
     float GetEffectDepthBias() const;
     int GetWidth() const;
@@ -59,7 +65,7 @@ class Text3D : public Drawable
     const Color& GetColor(Corner corner) const;
     float GetOpacity() const;
     FaceCameraMode GetFaceCameraMode() const;
-    
+
     tolua_property__get_set Font* font;
     tolua_property__get_set Material* material;
     tolua_readonly tolua_property__get_set int fontSize;
@@ -70,6 +76,9 @@ class Text3D : public Drawable
     tolua_property__get_set float rowSpacing;
     tolua_property__get_set bool wordwrap;
     tolua_property__get_set TextEffect textEffect;
+    tolua_property__get_set IntVector2 effectShadowOffset;
+    tolua_property__get_set int effectStrokeThickness;
+    tolua_property__get_set bool effectRoundStroke;
     tolua_property__get_set Color& effectColor;
     tolua_property__get_set float effectDepthBias;
     tolua_property__get_set int width;
@@ -96,4 +105,4 @@ static int tolua_UILuaAPI_Text3D_new00_local(lua_State* tolua_S)
 
 #define TOLUA_DISABLE_tolua_get_Text3D_color_ref
 #define tolua_get_Text3D_color_ref NULL
-$}
+$}