Text3D.pkg 4.2 KB

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