TDME2  1.9.200
GUITextNode.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include <string>
4 #include <vector>
5 
6 #include <tdme/tdme.h>
7 #include <tdme/gui/fwd-tdme.h>
10 #include <tdme/gui/nodes/GUINode.h>
15 
16 using std::string;
17 using std::vector;
18 
34 
35 /**
36  * GUI text node
37  * @author Andreas Drewke
38  */
40  : public GUINode
41 {
42  friend class tdme::gui::GUIParser;
43 
44 private:
45  GUIFont* font { nullptr };
48 
49 protected:
50  // forbid class copy
52 
53  /**
54  * Constructor
55  * @param screenNode screen node
56  * @param parentNode parent node
57  * @param id id
58  * @param flow flow
59  * @param alignments alignments
60  * @param requestedConstraints requested constraints
61  * @param backgroundColor background color
62  * @param backgroundImage background image
63  * @param backgroundImageScale9Grid background image scale 9 grid
64  * @param backgroundImageEffectColorMul background image effect color mul
65  * @param backgroundImageEffectColorAdd background image effect color add
66  * @param border border
67  * @param padding padding
68  * @param showOn show on
69  * @param hideOn hide on
70  * @param tooltip tooltip
71  * @param font font
72  * @param size size
73  * @param color color
74  * @param text text
75  * @throws tdme::gui::GUIParserException
76  */
80  const string& id,
85  const string& backgroundImage,
89  const GUINode_Border& border,
90  const GUINode_Padding& padding,
93  const string& tooltip,
94  const string& font,
95  int size,
96  const string& color,
97  const MutableString& text
98  );
99 
100  // overridden methods
101  const string getNodeType() override;
102  bool isContentNode() override;
103 
104 public:
105  // overridden methods
106  int getContentWidth() override;
107  int getContentHeight() override;
108 
109  /**
110  * @return text
111  */
112  inline const MutableString& getText() const {
113  return text;
114  }
115 
116  /**
117  * Set text
118  * @param text text
119  */
120  void setText(const MutableString& text);
121 
122  // overridden methods
123  void dispose() override;
124  void render(GUIRenderer* guiRenderer) override;
125 };
GUI parser.
Definition: GUIParser.h:40
GUI element node conditions.
GUI node base class.
Definition: GUINode.h:64
GUINodeConditions hideOn
Definition: GUINode.h:162
GUIColor backgroundImageEffectColorMul
Definition: GUINode.h:157
GUINode_Border border
Definition: GUINode.h:160
GUINode_Scale9Grid backgroundImageScale9Grid
Definition: GUINode.h:156
GUIColor backgroundImageEffectColorAdd
Definition: GUINode.h:158
GUIParentNode * parentNode
Definition: GUINode.h:148
GUINode_Padding padding
Definition: GUINode.h:159
GUIScreenNode * screenNode
Definition: GUINode.h:147
GUINode_RequestedConstraints requestedConstraints
Definition: GUINode.h:151
GUINode_Alignments alignments
Definition: GUINode.h:150
GUINodeConditions showOn
Definition: GUINode.h:161
GUINode_Flow * flow
Definition: GUINode.h:86
GUI parent node base class thats supporting child nodes.
Definition: GUIParentNode.h:42
GUI screen node that represents a screen that can be rendered via GUI system.
Definition: GUIScreenNode.h:72
GUITextNode(GUIScreenNode *screenNode, GUIParentNode *parentNode, const string &id, GUINode_Flow *flow, const GUINode_Alignments &alignments, const GUINode_RequestedConstraints &requestedConstraints, const GUIColor &backgroundColor, const string &backgroundImage, const GUINode_Scale9Grid &backgroundImageScale9Grid, const GUIColor &backgroundImageEffectColorMul, const GUIColor &backgroundImageEffectColorAdd, const GUINode_Border &border, const GUINode_Padding &padding, const GUINodeConditions &showOn, const GUINodeConditions &hideOn, const string &tooltip, const string &font, int size, const string &color, const MutableString &text)
Constructor.
Definition: GUITextNode.cpp:31
const string getNodeType() override
Definition: GUITextNode.cpp:61
void dispose() override
Dispose node.
Definition: GUITextNode.cpp:87
void setText(const MutableString &text)
Set text.
Definition: GUITextNode.cpp:81
void render(GUIRenderer *guiRenderer) override
Render.
Definition: GUITextNode.cpp:93
const MutableString & getText() const
Definition: GUITextNode.h:112
GUI font class.
Definition: GUIFont.h:41
Mutable utf8 aware string class.
Definition: MutableString.h:23
std::exception Exception
Exception base class.
Definition: Exception.h:18
GUI node border entity.
GUI node padding entity.
GUI node scale 9 grid entity.
#define FORBID_CLASS_COPY(CLASS)
Definition: tdme.h:6