Main Page   Namespace List   Compound List   File List   Namespace Members   Compound Members   File Members  

/include/ZE_ZRect.h

Go to the documentation of this file.
00001 /*******************************************************************************
00002         This file is Part of the ZEngine Library for 2D game development.
00003                    Copyright (C) 2002, 2003 James Turk
00004 
00005                      Licensed under a BSD-style license.
00006 
00007     The maintainer of this library is James Turk (james@conceptofzero.net) 
00008      and the home of this Library is http://www.zengine.sourceforge.net
00009 *******************************************************************************/
00010 
00024 #ifndef __ze_zrect_h__
00025 #define __ze_zrect_h__
00026 
00027 #include "ZE_ZEngine.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 SDL_Rect &rect);
00076 
00083         ZRect(const ZRect &rhs);
00084 
00092         const ZRect& operator=(const ZRect &rhs);
00093 
00099         virtual ~ZRect();
00100 
00109         bool operator<(const ZRect &rhs) const;
00110 
00120         void Draw(Uint8 red, Uint8 green, Uint8 blue, Uint8 alpha=255) const;
00121 
00129         void Move(float x, float y);
00130 
00138         void MoveRel(float xMove, float yMove);
00139 
00147         void Resize(float width, float height);
00148 
00156         void ResizeRel(float widthChange, float heightChange);
00157 
00165         bool Intersects(const ZRect &rect) const;
00166 
00175         bool Contains(float x, float y) const;
00176 
00184         bool Contains(const ZRect &rect) const;
00185 
00193         ZRect Intersection(const ZRect &rect) const;
00194 
00201         SDL_Rect SDLrect() const;
00202 
00209         float X() const;
00210 
00217         float Y() const;
00218 
00225         float Left() const;
00226 
00233         float Right() const;
00234 
00241         float Top() const;
00242 
00249         float Bottom() const;
00250 
00257         float Width() const;
00258 
00265         float Height() const;
00266 };
00267 
00268 } //namespace ZE
00269 
00270 #endif //__ze_zrect_h__

Generated on Sun Apr 27 21:57:34 2003 for ZEngine by doxygen1.3-rc2