00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026 #ifndef _CEGUIRenderableImage_h_
00027 #define _CEGUIRenderableImage_h_
00028
00029 #include "CEGUIBase.h"
00030 #include "CEGUIRenderableElement.h"
00031
00032
00033
00034 namespace CEGUI
00035 {
00044 class CEGUIEXPORT RenderableImage : public RenderableElement
00045 {
00046 public:
00047
00048
00049
00054 enum HorzFormatting
00055 {
00056 LeftAligned,
00057 RightAligned,
00058 HorzCentred,
00059 HorzStretched,
00060 HorzTiled
00061 };
00062
00063
00068 enum VertFormatting
00069 {
00070 TopAligned,
00071 BottomAligned,
00072 VertCentred,
00073 VertStretched,
00074 VertTiled
00075 };
00076
00077
00078
00079
00080
00085 RenderableImage(void);
00086
00087
00092 virtual ~RenderableImage(void);
00093
00094
00095
00096
00097
00108 void setImage(const Image* image) {d_image = image;}
00109
00110
00121 void setHorzFormatting(HorzFormatting formatting) {d_horzFormat = formatting;}
00122
00123
00134 void setVertFormatting(VertFormatting formatting) {d_vertFormat = formatting;}
00135
00136
00147 void setQuadSplitMode(QuadSplitMode split_mode) {d_quadSplitMode = split_mode;}
00148
00149
00157 const Image* getImage(void) const {return d_image;}
00158
00159
00167 HorzFormatting getHorzFormatting(void) const {return d_horzFormat;}
00168
00169
00177 VertFormatting getVertFormatting(void) const {return d_vertFormat;}
00178
00179
00187 QuadSplitMode getQuadSplitMode(void) const {return d_quadSplitMode;}
00188
00189
00190 protected:
00191
00192
00193
00207 void draw_impl(const Vector3& position, const Rect& clip_rect) const;
00208
00209
00210 void draw_impl(RenderCache& renderCache) const;
00211
00216 uint getHorzTileCount() const;
00217
00222 uint getVertTileCount() const;
00223
00228 float getBaseXCoord(const Size& sz) const;
00229
00234 float getBaseYCoord(const Size& sz) const;
00235
00240 Size getDestinationSize() const;
00241
00242
00243
00244
00245 HorzFormatting d_horzFormat;
00246 VertFormatting d_vertFormat;
00247 QuadSplitMode d_quadSplitMode;
00248 const Image* d_image;
00249 };
00250
00251 }
00252
00253
00254 #endif // end of guard _CEGUIRenderableImage_h_