00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00024 #ifndef __ze_zrect_h__
00025 #define __ze_zrect_h__
00026
00027 #include "ZE_ZObject.h"
00028
00029 namespace ZE
00030 {
00031
00037 class ZRect
00038 {
00039 protected:
00041 float rX;
00043 float rY;
00045 float rWidth;
00047 float rHeight;
00048
00049 public:
00050
00056 ZRect();
00057
00067 ZRect(float x, float y, float width, float height);
00068
00075 ZRect(const ZRect &rhs);
00076
00084 const ZRect& operator=(const ZRect &rhs);
00085
00094 bool operator<(const ZRect &rhs) const;
00095
00105 void Draw(Uint8 red, Uint8 green, Uint8 blue, Uint8 alpha=255);
00106
00114 void Move(float x, float y);
00115
00123 void MoveRel(float xMove, float yMove);
00124
00132 void Resize(float width, float height);
00133
00141 void ResizeRel(float widthChange, float heightChange);
00142
00150 bool Intersects(const ZRect &rect) const;
00151
00160 bool Contains(float x, float y) const;
00161
00169 bool Contains(const ZRect &rect) const;
00170
00178 ZRect Intersection(const ZRect &rect) const;
00179
00186 SDL_Rect SDLrect() const;
00187
00194 float X() const;
00195
00202 float Y() const;
00203
00210 float Left() const;
00211
00218 float Right() const;
00219
00226 float Top() const;
00227
00234 float Bottom() const;
00235
00242 float Width() const;
00243
00250 float Height() const;
00251 };
00252
00253 }
00254
00255 #endif //__ze_zrect_h__