Text3D.pkg 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. $#include "UI/Text3D.h"
  2. // Duplicated here from GraphicsDefs.pkg to so that enum is bound correctly to Text3D
  3. enum FaceCameraMode
  4. {
  5. FC_NONE = 0,
  6. FC_ROTATE_XYZ,
  7. FC_ROTATE_Y,
  8. FC_LOOKAT_XYZ,
  9. FC_LOOKAT_Y
  10. };
  11. class Text3D : public Drawable
  12. {
  13. Text3D();
  14. ~Text3D();
  15. bool SetFont(const String fontName, int size = DEFAULT_FONT_SIZE);
  16. bool SetFont(Font* font, int size = DEFAULT_FONT_SIZE);
  17. bool SetFontSize(int size);
  18. void SetMaterial(Material* material);
  19. void SetText(const String text);
  20. void SetAlignment(HorizontalAlignment hAlign, VerticalAlignment vAlign);
  21. void SetHorizontalAlignment(HorizontalAlignment align);
  22. void SetVerticalAlignment(VerticalAlignment align);
  23. void SetTextAlignment(HorizontalAlignment align);
  24. void SetRowSpacing(float spacing);
  25. void SetWordwrap(bool enable);
  26. void SetTextEffect(TextEffect textEffect);
  27. void SetEffectShadowOffset(const IntVector2& offset);
  28. void SetEffectStrokeThickness(int thickness);
  29. void SetEffectRoundStroke(bool roundStroke);
  30. void SetEffectColor(const Color& effectColor);
  31. void SetEffectDepthBias(float bias);
  32. void SetWidth(int width);
  33. void SetColor(const Color& color);
  34. void SetColor(Corner corner, const Color& color);
  35. void SetOpacity(float opacity);
  36. void SetFixedScreenSize(bool enable);
  37. void SetFaceCameraMode(FaceCameraMode mode);
  38. Font* GetFont() const;
  39. Material* GetMaterial() const;
  40. int GetFontSize() const;
  41. const String GetText() const;
  42. HorizontalAlignment GetTextAlignment() const;
  43. HorizontalAlignment GetHorizontalAlignment() const;
  44. VerticalAlignment GetVerticalAlignment() const;
  45. float GetRowSpacing() const;
  46. bool GetWordwrap() const;
  47. TextEffect GetTextEffect() const;
  48. const IntVector2& GetEffectShadowOffset() const;
  49. int GetEffectStrokeThickness() const;
  50. bool GetEffectRoundStroke() const;
  51. const Color& GetEffectColor() const;
  52. float GetEffectDepthBias() const;
  53. int GetWidth() const;
  54. int GetRowHeight() const;
  55. unsigned GetNumRows() const;
  56. unsigned GetNumChars() const;
  57. int GetRowWidth(unsigned index) const;
  58. IntVector2 GetCharPosition(unsigned index);
  59. IntVector2 GetCharSize(unsigned index);
  60. const Color& GetColor(Corner corner) const;
  61. float GetOpacity() const;
  62. bool IsFixedScreenSize() const;
  63. FaceCameraMode GetFaceCameraMode() const;
  64. tolua_property__get_set Font* font;
  65. tolua_property__get_set Material* material;
  66. tolua_property__get_set int fontSize;
  67. tolua_property__get_set String text;
  68. tolua_property__get_set HorizontalAlignment textAlignment;
  69. tolua_property__get_set HorizontalAlignment horizontalAlignment;
  70. tolua_property__get_set VerticalAlignment verticalAlignment;
  71. tolua_property__get_set float rowSpacing;
  72. tolua_property__get_set bool wordwrap;
  73. tolua_property__get_set TextEffect textEffect;
  74. tolua_property__get_set IntVector2& effectShadowOffset;
  75. tolua_property__get_set int effectStrokeThickness;
  76. tolua_property__get_set bool effectRoundStroke;
  77. tolua_property__get_set Color& effectColor;
  78. tolua_property__get_set float effectDepthBias;
  79. tolua_property__get_set int width;
  80. tolua_property__get_set Color& color; // Write only property.
  81. tolua_readonly tolua_property__get_set int rowHeight;
  82. tolua_readonly tolua_property__get_set unsigned numRows;
  83. tolua_readonly tolua_property__get_set unsigned numChars;
  84. tolua_property__get_set float opacity;
  85. tolua_property__is_set bool fixedScreenSize;
  86. tolua_property__get_set FaceCameraMode faceCameraMode;
  87. };
  88. ${
  89. #define TOLUA_DISABLE_tolua_UILuaAPI_Text3D_new00
  90. static int tolua_UILuaAPI_Text3D_new00(lua_State* tolua_S)
  91. {
  92. return ToluaNewObject<Text3D>(tolua_S);
  93. }
  94. #define TOLUA_DISABLE_tolua_UILuaAPI_Text3D_new00_local
  95. static int tolua_UILuaAPI_Text3D_new00_local(lua_State* tolua_S)
  96. {
  97. return ToluaNewObjectGC<Text3D>(tolua_S);
  98. }
  99. #define TOLUA_DISABLE_tolua_get_Text3D_color_ref
  100. #define tolua_get_Text3D_color_ref NULL
  101. $}