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_TILE_RECT_H_
8 #define MYGUI_TILE_RECT_H_
9 
10 #include "MyGUI_Prerequest.h"
11 #include "MyGUI_XmlDocument.h"
12 #include "MyGUI_Types.h"
13 #include "MyGUI_ISubWidgetRect.h"
14 #include "MyGUI_ResourceSkin.h"
15 #include "MyGUI_RenderFormat.h"
16 
17 namespace MyGUI
18 {
19 
20 	class RenderItem;
21 
22 	class MYGUI_EXPORT TileRect :
23 		public ISubWidgetRect
24 	{
25 		MYGUI_RTTI_DERIVED( TileRect )
26 
27 	public:
28 		TileRect();
29 
30 		void setAlpha(float _alpha) override;
31 
32 		void setVisible(bool _visible) override;
33 
34 		void createDrawItem(ITexture* _texture, ILayerNode* _node) override;
35 		void destroyDrawItem() override;
36 
37 		// метод для отрисовки себя
38 		void doRender() override;
39 
40 		void setStateData(IStateInfo* _data) override;
41 
42 		/*internal:*/
43 		void _updateView() override;
44 		void _correctView() override;
45 
46 		void _setAlign(const IntSize& _oldsize) override;
47 
48 		void _setUVSet(const FloatRect& _rect) override;
49 		void _setColour(const Colour& _value) override;
50 
51 	protected:
52 		bool mEmptyView;
53 
54 		VertexColourType mVertexFormat;
55 		uint32 mCurrentColour;
56 
57 		FloatRect mCurrentTexture;
58 		IntCoord mCurrentCoord;
59 
60 		ILayerNode* mNode;
61 		RenderItem* mRenderItem;
62 
63 		IntSize mTileSize;
64 		size_t mCountVertex;
65 
66 		float mRealTileWidth;
67 		float mRealTileHeight;
68 
69 		float mTextureHeightOne;
70 		float mTextureWidthOne;
71 
72 		bool mTileH;
73 		bool mTileV;
74 	};
75 
76 } // namespace MyGUI
77 
78 #endif // MYGUI_TILE_RECT_H_
79