MyGUI  3.0.1
MyGUI_TileRect.h
Go to the documentation of this file.
00001 
00007 /*
00008     This file is part of MyGUI.
00009 
00010     MyGUI is free software: you can redistribute it and/or modify
00011     it under the terms of the GNU Lesser General Public License as published by
00012     the Free Software Foundation, either version 3 of the License, or
00013     (at your option) any later version.
00014 
00015     MyGUI is distributed in the hope that it will be useful,
00016     but WITHOUT ANY WARRANTY; without even the implied warranty of
00017     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00018     GNU Lesser General Public License for more details.
00019 
00020     You should have received a copy of the GNU Lesser General Public License
00021     along with MyGUI.  If not, see <http://www.gnu.org/licenses/>.
00022 */
00023 #ifndef __MYGUI_TILE_RECT_H__
00024 #define __MYGUI_TILE_RECT_H__
00025 
00026 #include "MyGUI_Prerequest.h"
00027 #include "MyGUI_XmlDocument.h"
00028 #include "MyGUI_Types.h"
00029 #include "MyGUI_ISubWidgetRect.h"
00030 #include "MyGUI_ResourceSkin.h"
00031 
00032 namespace MyGUI
00033 {
00034 
00035     class RenderItem;
00036 
00037     class MYGUI_EXPORT TileRect : public ISubWidgetRect
00038     {
00039         MYGUI_RTTI_DERIVED( TileRect )
00040 
00041     public:
00042         TileRect();
00043         virtual ~TileRect();
00044 
00045         void setAlpha(float _alpha);
00046 
00047         virtual void setVisible(bool _visible);
00048 
00049         virtual void createDrawItem(ITexture* _texture, ILayerNode * _node);
00050         virtual void destroyDrawItem();
00051 
00052         // метод для отрисовки себя
00053         virtual void doRender();
00054 
00055         virtual void setStateData(IStateInfo * _data);
00056 
00057     /*internal:*/
00058         void _updateView();
00059         void _correctView();
00060 
00061         void _setAlign(const IntSize& _oldsize, bool _update);
00062         void _setAlign(const IntCoord& _oldcoord, bool _update);
00063 
00064         virtual void _setUVSet(const FloatRect& _rect);
00065         virtual void _setColour(const Colour& _value);
00066 
00067     protected:
00068         FloatRect mRectTexture;
00069         bool mEmptyView;
00070 
00071         uint32 mCurrentColour;
00072 
00073         FloatRect mCurrentTexture;
00074         IntCoord mCurrentCoord;
00075 
00076         ILayerNode* mNode;
00077         RenderItem* mRenderItem;
00078 
00079         IntSize mTileSize;
00080         size_t mCountVertex;
00081 
00082         float mRealTileWidth;
00083         float mRealTileHeight;
00084 
00085         float mTextureHeightOne;
00086         float mTextureWidthOne;
00087 
00088         bool mTileH;
00089         bool mTileV;
00090     };
00091 
00092 } // namespace MyGUI
00093 
00094 #endif // __MYGUI_TILE_RECT_H__