Text3D.pkg 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. $#include "Text3D.h"
  2. /// 3D text component.
  3. class Text3D : public Drawable
  4. {
  5. public:
  6. /// Set font and font size. Return true if successful.
  7. bool SetFont(const String& fontName, int size = DEFAULT_FONT_SIZE);
  8. /// Set font and font size. Return true if successful.
  9. bool SetFont(Font* font, int size = DEFAULT_FONT_SIZE);
  10. /// Set material.
  11. void SetMaterial(Material* material);
  12. /// Set text. Text is assumed to be either ASCII or UTF8-encoded.
  13. void SetText(const String& text);
  14. /// Set horizontal and vertical alignment.
  15. void SetAlignment(HorizontalAlignment hAlign, VerticalAlignment vAlign);
  16. /// Set horizontal alignment.
  17. void SetHorizontalAlignment(HorizontalAlignment align);
  18. /// Set vertical alignment.
  19. void SetVerticalAlignment(VerticalAlignment align);
  20. /// Set row alignment.
  21. void SetTextAlignment(HorizontalAlignment align);
  22. /// Set row spacing, 1.0 for original font spacing.
  23. void SetRowSpacing(float spacing);
  24. /// Set wordwrap. In wordwrap mode the text element will respect its current width. Otherwise it resizes itself freely.
  25. void SetWordwrap(bool enable);
  26. /// Set text width. Only has effect in word wrap mode.
  27. void SetWidth(int width);
  28. /// Set color on all corners.
  29. void SetColor(const Color& color);
  30. /// Set color on one corner.
  31. void SetColor(Corner corner, const Color& color);
  32. /// Set opacity.
  33. void SetOpacity(float opacity);
  34. /// Set whether to face camera automatically.
  35. void SetFaceCamera(bool enable);
  36. /// Return font.
  37. Font* GetFont() const;
  38. /// Return material.
  39. Material* GetMaterial() const;
  40. /// Return font size.
  41. int GetFontSize() const;
  42. /// Return text.
  43. const String& GetText() const;
  44. /// Return row alignment.
  45. HorizontalAlignment GetTextAlignment() const;
  46. /// Return horizontal alignment.
  47. HorizontalAlignment GetHorizontalAlignment() const;
  48. /// Return vertical alignment.
  49. VerticalAlignment GetVerticalAlignment() const;
  50. /// Return row spacing.
  51. float GetRowSpacing() const;
  52. /// Return wordwrap mode.
  53. bool GetWordwrap() const;
  54. /// Return text width.
  55. int GetWidth() const;
  56. /// Return row height.
  57. int GetRowHeight() const;
  58. /// Return number of rows.
  59. unsigned GetNumRows() const;
  60. /// Return corner color.
  61. const Color& GetColor(Corner corner) const;
  62. /// Return opacity.
  63. float GetOpacity() const;
  64. /// Return whether faces camera automatically.
  65. bool GetFaceCamera() const { return faceCamera_; }
  66. };