MyGUI  3.0.1
MyGUI_TileRect.h
Go to the documentation of this file.
1 
7 /*
8  This file is part of MyGUI.
9 
10  MyGUI is free software: you can redistribute it and/or modify
11  it under the terms of the GNU Lesser General Public License as published by
12  the Free Software Foundation, either version 3 of the License, or
13  (at your option) any later version.
14 
15  MyGUI is distributed in the hope that it will be useful,
16  but WITHOUT ANY WARRANTY; without even the implied warranty of
17  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18  GNU Lesser General Public License for more details.
19 
20  You should have received a copy of the GNU Lesser General Public License
21  along with MyGUI. If not, see <http://www.gnu.org/licenses/>.
22 */
23 #ifndef __MYGUI_TILE_RECT_H__
24 #define __MYGUI_TILE_RECT_H__
25 
26 #include "MyGUI_Prerequest.h"
27 #include "MyGUI_XmlDocument.h"
28 #include "MyGUI_Types.h"
29 #include "MyGUI_ISubWidgetRect.h"
30 #include "MyGUI_ResourceSkin.h"
31 
32 namespace MyGUI
33 {
34 
35  class RenderItem;
36 
38  {
40 
41  public:
42  TileRect();
43  virtual ~TileRect();
44 
45  void setAlpha(float _alpha);
46 
47  virtual void setVisible(bool _visible);
48 
49  virtual void createDrawItem(ITexture* _texture, ILayerNode * _node);
50  virtual void destroyDrawItem();
51 
52  // метод для отрисовки себя
53  virtual void doRender();
54 
55  virtual void setStateData(IStateInfo * _data);
56 
57  /*internal:*/
58  void _updateView();
59  void _correctView();
60 
61  void _setAlign(const IntSize& _oldsize, bool _update);
62  void _setAlign(const IntCoord& _oldcoord, bool _update);
63 
64  virtual void _setUVSet(const FloatRect& _rect);
65  virtual void _setColour(const Colour& _value);
66 
67  protected:
68  FloatRect mRectTexture;
69  bool mEmptyView;
70 
71  uint32 mCurrentColour;
72 
73  FloatRect mCurrentTexture;
74  IntCoord mCurrentCoord;
75 
76  ILayerNode* mNode;
77  RenderItem* mRenderItem;
78 
79  IntSize mTileSize;
80  size_t mCountVertex;
81 
82  float mRealTileWidth;
83  float mRealTileHeight;
84 
85  float mTextureHeightOne;
86  float mTextureWidthOne;
87 
88  bool mTileH;
89  bool mTileV;
90  };
91 
92 } // namespace MyGUI
93 
94 #endif // __MYGUI_TILE_RECT_H__