| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172 |
- $#include "Text3D.h"
- /// 3D text component.
- class Text3D : public Drawable
- {
- public:
- /// Construct.
- Text3D(Context* context);
- /// Destruct.
- ~Text3D();
- /// Set font and font size. Return true if successful.
- bool SetFont(const String& fontName, int size = DEFAULT_FONT_SIZE);
- /// Set font and font size. Return true if successful.
- bool SetFont(Font* font, int size = DEFAULT_FONT_SIZE);
- /// Set material.
- void SetMaterial(Material* material);
- /// Set text. Text is assumed to be either ASCII or UTF8-encoded.
- void SetText(const String& text);
- /// Set horizontal and vertical alignment.
- void SetAlignment(HorizontalAlignment hAlign, VerticalAlignment vAlign);
- /// Set horizontal alignment.
- void SetHorizontalAlignment(HorizontalAlignment align);
- /// Set vertical alignment.
- void SetVerticalAlignment(VerticalAlignment align);
- /// Set row alignment.
- void SetTextAlignment(HorizontalAlignment align);
- /// Set row spacing, 1.0 for original font spacing.
- void SetRowSpacing(float spacing);
- /// Set wordwrap. In wordwrap mode the text element will respect its current width. Otherwise it resizes itself freely.
- void SetWordwrap(bool enable);
- /// Set text width. Only has effect in word wrap mode.
- void SetWidth(int width);
- /// Set color on all corners.
- void SetColor(const Color& color);
- /// Set color on one corner.
- void SetColor(Corner corner, const Color& color);
- /// Set opacity.
- void SetOpacity(float opacity);
- /// Set whether to face camera automatically.
- void SetFaceCamera(bool enable);
-
- /// Return font.
- Font* GetFont() const;
- /// Return material.
- Material* GetMaterial() const;
- /// Return font size.
- int GetFontSize() const;
- /// Return text.
- const String& GetText() const;
- /// Return row alignment.
- HorizontalAlignment GetTextAlignment() const;
- /// Return horizontal alignment.
- HorizontalAlignment GetHorizontalAlignment() const;
- /// Return vertical alignment.
- VerticalAlignment GetVerticalAlignment() const;
- /// Return row spacing.
- float GetRowSpacing() const;
- /// Return wordwrap mode.
- bool GetWordwrap() const;
- /// Return text width.
- int GetWidth() const;
- /// Return row height.
- int GetRowHeight() const;
- /// Return number of rows.
- unsigned GetNumRows() const;
- /// Return corner color.
- const Color& GetColor(Corner corner) const;
- /// Return opacity.
- float GetOpacity() const;
- /// Return whether faces camera automatically.
- bool GetFaceCamera() const { return faceCamera_; }
- };
|