00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00020 #ifndef __ze_zrect_h__
00021 #define __ze_zrect_h__
00022
00023 #include "ZE_ZEngine.h"
00024
00025 namespace ZE
00026 {
00027
00033 class ZRect
00034 {
00035 protected:
00037 ZEngine* rEngine;
00039 float rX;
00041 float rY;
00043 float rWidth;
00045 float rHeight;
00046
00047 public:
00048
00054 ZRect();
00055
00065 ZRect(float x, float y, float width, float height);
00066
00073 ZRect(const SDL_Rect &rect);
00074
00081 ZRect(const ZRect &rhs);
00082
00088 virtual ~ZRect();
00089
00097 const ZRect& operator=(const ZRect &rhs);
00098
00107 bool operator<(const ZRect &rhs) const;
00108
00118 void Draw(Uint8 red, Uint8 green, Uint8 blue, Uint8 alpha=255) const;
00119
00127 void Move(float x, float y);
00128
00136 void MoveRel(float xMove, float yMove);
00137
00145 void Resize(float width, float height);
00146
00154 void ResizeRel(float widthChange, float heightChange);
00155
00163 bool Intersects(const ZRect &rect) const;
00164
00173 bool Contains(float x, float y) const;
00174
00182 bool Contains(const ZRect &rect) const;
00183
00191 ZRect Intersection(const ZRect &rect) const;
00192
00199 SDL_Rect SDLrect() const;
00200
00207 float X() const;
00208
00215 float Y() const;
00216
00223 float Left() const;
00224
00231 float Right() const;
00232
00239 float Top() const;
00240
00247 float Bottom() const;
00248
00255 float Width() const;
00256
00263 float Height() const;
00264 };
00265
00266 }
00267
00268 #endif //__ze_zrect_h__