MyGUI 3.5.3
MyGUI_RotatingSkin.h
Go to the documentation of this file.
1/*
2 * This source file is part of MyGUI. For the latest info, see http://mygui.info/
3 * Distributed under the MIT License
4 * (See accompanying file COPYING.MIT or copy at http://opensource.org/licenses/MIT)
5 */
6
7#ifndef MYGUI_ROTATING_SKIN_H_
8#define MYGUI_ROTATING_SKIN_H_
9
10#include "MyGUI_Prerequest.h"
11
12#ifndef MYGUI_DONT_USE_OBSOLETE
13
14 #include "MyGUI_Diagnostic.h"
15 #include "MyGUI_Types.h"
16 #include "MyGUI_ISubWidgetRect.h"
17 #include "MyGUI_RenderFormat.h"
18
19namespace MyGUI
20{
21
23 class MYGUI_OBSOLETE("RotatingSkin is deprecated; use Widget::setRotation() and Widget::setRotationCenter().")
24 MYGUI_EXPORT RotatingSkin : public ISubWidgetRect
25 {
26 MYGUI_RTTI_DERIVED(RotatingSkin)
27
28 public:
29 RotatingSkin();
30
32 void setAngle(float _angle);
34 float getAngle() const;
35
39 void setCenter(const IntPoint& _center);
41 IntPoint getCenter(bool _local = true) const;
42
43 void setAlpha(float _alpha) override;
44
45 void setVisible(bool _visible) override;
46
47 void setStateData(IStateInfo* _data) override;
48
49 void createDrawItem(ITexture* _texture, ILayerNode* _node) override;
50 void destroyDrawItem() override;
51
52 void doRender() override;
53
54 /*internal:*/
55 void _updateView() override;
56 void _correctView() override;
57
58 void _setAlign(const IntSize& _oldsize) override;
59
60 void _setUVSet(const FloatRect& _rect) override;
61 void _setColour(const Colour& _value) override;
62
63 protected:
64 void _rebuildGeometry();
65
66 private:
67 bool mGeometryOutdated{false};
68
69 float mAngle{0.0f};
70 IntPoint mCenterPos;
71
72 enum
73 {
74 RECT_VERTICIES_COUNT = 4,
75 GEOMETRY_VERTICIES_TOTAL_COUNT = 8
76 };
77 FloatPoint mResultVerticiesPos[GEOMETRY_VERTICIES_TOTAL_COUNT];
78 FloatPoint mResultVerticiesUV[GEOMETRY_VERTICIES_TOTAL_COUNT];
79 size_t mVertexCount{0};
80
81 bool mEmptyView{false};
82
83 VertexColourType mVertexFormat;
84 uint32 mCurrentColour{0xFFFFFFFF};
85
86 FloatRect mCurrentTexture;
87 IntCoord mCurrentCoord;
88
89 ILayerNode* mNode{nullptr};
90 RenderItem* mRenderItem{nullptr};
91 };
92
93} // namespace MyGUI
94
95#endif // MYGUI_DONT_USE_OBSOLETE
96
97#endif // MYGUI_ROTATING_SKIN_H_
#define MYGUI_OBSOLETE(text)
#define MYGUI_EXPORT
#define MYGUI_RTTI_DERIVED(DerivedType)
Definition MyGUI_RTTI.h:67
uint32_t uint32
Definition MyGUI_Types.h:47
types::TPoint< int > IntPoint
Definition MyGUI_Types.h:26
types::TRect< float > FloatRect
Definition MyGUI_Types.h:33
types::TPoint< float > FloatPoint
Definition MyGUI_Types.h:27
types::TCoord< int > IntCoord
Definition MyGUI_Types.h:35