MyGUI
3.2.0
|
00001 00006 /* 00007 This file is part of MyGUI. 00008 00009 MyGUI is free software: you can redistribute it and/or modify 00010 it under the terms of the GNU Lesser General Public License as published by 00011 the Free Software Foundation, either version 3 of the License, or 00012 (at your option) any later version. 00013 00014 MyGUI is distributed in the hope that it will be useful, 00015 but WITHOUT ANY WARRANTY; without even the implied warranty of 00016 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00017 GNU Lesser General Public License for more details. 00018 00019 You should have received a copy of the GNU Lesser General Public License 00020 along with MyGUI. If not, see <http://www.gnu.org/licenses/>. 00021 */ 00022 #ifndef __MYGUI_ROTATING_SKIN_H__ 00023 #define __MYGUI_ROTATING_SKIN_H__ 00024 00025 #include "MyGUI_Prerequest.h" 00026 #include "MyGUI_Types.h" 00027 #include "MyGUI_ISubWidgetRect.h" 00028 #include "MyGUI_RenderFormat.h" 00029 00030 namespace MyGUI 00031 { 00032 00033 class MYGUI_EXPORT RotatingSkin : 00034 public ISubWidgetRect 00035 { 00036 MYGUI_RTTI_DERIVED( RotatingSkin ) 00037 00038 public: 00039 RotatingSkin(); 00040 virtual ~RotatingSkin(); 00041 00043 void setAngle(float _angle); 00045 float getAngle() const; 00046 00050 void setCenter(const IntPoint& _center); 00052 IntPoint getCenter(bool _local = true) const; 00053 00054 virtual void setAlpha(float _alpha); 00055 00056 virtual void setVisible(bool _visible); 00057 00058 virtual void setStateData(IStateInfo* _data); 00059 00060 virtual void createDrawItem(ITexture* _texture, ILayerNode* _node); 00061 virtual void destroyDrawItem(); 00062 00063 // метод для отрисовки себя 00064 virtual void doRender(); 00065 00066 /*internal:*/ 00067 virtual void _updateView(); 00068 virtual void _correctView(); 00069 00070 virtual void _setAlign(const IntSize& _oldsize); 00071 00072 virtual void _setUVSet(const FloatRect& _rect); 00073 virtual void _setColour(const Colour& _value); 00074 00075 protected: 00076 void _rebuildGeometry(); 00077 00078 private: 00079 bool mGeometryOutdated; 00080 00081 float mAngle; 00082 IntPoint mCenterPos; 00083 00084 enum {RECT_VERTICIES_COUNT = 4, GEOMETRY_VERTICIES_TOTAL_COUNT = 8}; 00085 FloatPoint mResultVerticiesPos[GEOMETRY_VERTICIES_TOTAL_COUNT]; 00086 FloatPoint mResultVerticiesUV[GEOMETRY_VERTICIES_TOTAL_COUNT]; 00087 00088 bool mEmptyView; 00089 00090 VertexColourType mVertexFormat; 00091 uint32 mCurrentColour; 00092 00093 FloatRect mCurrentTexture; 00094 IntCoord mCurrentCoord; 00095 00096 ILayerNode* mNode; 00097 RenderItem* mRenderItem; 00098 }; 00099 00100 } // namespace MyGUI 00101 00102 #endif // __MYGUI_ROTATING_SKIN_H__