TDME2  1.9.200
GUIImageNode.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include <string>
4 
5 #include <tdme/tdme.h>
7 #include <tdme/engine/fwd-tdme.h>
8 #include <tdme/gui/fwd-tdme.h>
15 
16 using std::string;
17 
33 
34 /**
35  * GUI image node
36  * @author Andreas Drewke
37  */
39  : public GUITextureBaseNode
40 {
41  friend class tdme::gui::GUIParser;
42 
43 private:
44  bool releaseTextureReference { false };
45  string source;
46  Texture* texture { nullptr };
47  FrameBuffer* frameBuffer { nullptr };
49 
50  /**
51  * Release texture
52  */
53  void disposeTexture();
54 
55 protected:
56  // forbid class copy
58 
59  /**
60  * Constructor
61  * @param screenNode screen node
62  * @param parentNode parent node
63  * @param id id
64  * @param flow flow
65  * @param alignments alignments
66  * @param requestedConstraints requested constraints
67  * @param backgroundColor background color
68  * @param backgroundImage background image
69  * @param backgroundImageScale9Grid background image scale 9 grid
70  * @param backgroundImageEffectColorMul background image effect color mul
71  * @param backgroundImageEffectColorAdd background image effect color add
72  * @param border border
73  * @param padding padding
74  * @param showOn show on
75  * @param hideOn hide on
76  * @param tooltip tooltip
77  * @param source source
78  * @param requestedDimensionConstraints requested dimension constraints
79  * @param mirrorX mirror X
80  * @param mirrorY mirror Y
81  * @param effectColorMul effect color mul
82  * @param effectColorAdd effect color add
83  * @param scale9Grid scale 9 grid
84  * @param clipping clipping
85  * @param mask mask image
86  * @param maskMaxValue maximum value of mask to display image
87  * @param rotation rotation
88  * @throws tdme::gui::GUIParserException
89  */
93  const string& id,
98  const string& backgroundImage,
102  const GUINode_Border& border,
103  const GUINode_Padding& padding,
104  const GUINodeConditions& showOn,
105  const GUINodeConditions& hideOn,
106  const string& tooltip,
107  const string& source,
109  bool mirrorX,
110  bool mirrorY,
111  const GUIColor& effectColorMul,
112  const GUIColor& effectColorAdd,
114  const GUINode_Clipping& clipping,
115  const string& mask,
116  float maskMaxValue,
117  float rotation
118  );
119 
120  /**
121  * @return node type
122  */
123  const string getNodeType() override;
124 
125 public:
126  // overridden methods
127  void dispose() override;
128 
129 
130  /**
131  * @return texture
132  */
133  inline Texture* getTexture() {
134  return texture;
135  }
136 
137  /**
138  * @return image source
139  */
140  const string& getSource();
141 
142  /**
143  * Set image source
144  * @param source source
145  */
146  void setSource(const string& source);
147 
148  /**
149  * Set texture
150  * @param texture texture
151  */
152  void setTexture(Texture* texture);
153 
154  /**
155  * Set texture
156  * @param texture texture
157  */
159 
160  /**
161  * @return frame buffer
162  */
164 
165  /**
166  * Set frame buffer
167  * @param frameBuffer frame buffer
168  */
170 
171  /**
172  * Rotate image around center
173  */
174  void rotate(float rotation);
175 
176 };
Frame buffer class.
Definition: FrameBuffer.h:22
Texture entity.
Definition: Texture.h:24
GUI parser.
Definition: GUIParser.h:40
void disposeTexture()
Release texture.
const string getNodeType() override
void dispose() override
Dispose node.
void setTexture(Texture *texture)
Set texture.
void setSource(const string &source)
Set image source.
static STATIC_DLL_IMPEXT int thumbnailTextureIdx
Definition: GUIImageNode.h:48
void setFrameBuffer(FrameBuffer *frameBuffer)
Set frame buffer.
void rotate(float rotation)
Rotate image around center.
GUI element node conditions.
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
friend class GUIImageNode
Definition: GUINode.h:67
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
RequestedDimensionConstraints requestedDimensionConstraints
GUI node border entity.
GUI node clipping entity.
GUI node padding entity.
GUI node scale 9 grid entity.
#define STATIC_DLL_IMPEXT
Definition: tdme.h:15
#define FORBID_CLASS_COPY(CLASS)
Definition: tdme.h:6