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 float rX;
00039 float rY;
00041 float rWidth;
00043 float rHeight;
00044
00045 public:
00046
00052 ZRect();
00053
00063 ZRect(float x, float y, float width, float height);
00064
00071 ZRect(const SDL_Rect &rect);
00072
00079 ZRect(const ZRect &rhs);
00080
00088 const ZRect& operator=(const ZRect &rhs);
00089
00095 virtual ~ZRect();
00096
00105 bool operator<(const ZRect &rhs) const;
00106
00116 void Draw(Uint8 red, Uint8 green, Uint8 blue, Uint8 alpha=255) const;
00117
00125 void Move(float x, float y);
00126
00134 void MoveRel(float xMove, float yMove);
00135
00143 void Resize(float width, float height);
00144
00152 void ResizeRel(float widthChange, float heightChange);
00153
00161 bool Intersects(const ZRect &rect) const;
00162
00171 bool Contains(float x, float y) const;
00172
00180 bool Contains(const ZRect &rect) const;
00181
00189 ZRect Intersection(const ZRect &rect) const;
00190
00197 SDL_Rect SDLrect() const;
00198
00205 float X() const;
00206
00213 float Y() const;
00214
00221 float Left() const;
00222
00229 float Right() const;
00230
00237 float Top() const;
00238
00245 float Bottom() const;
00246
00253 float Width() const;
00254
00261 float Height() const;
00262 };
00263
00264 }
00265
00266 #endif //__ze_zrect_h__