Main Page   Namespace List   Class Hierarchy   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 SDL Game Development.
00003                       Copyright (C) 2002 ConceptOfZero.net
00004 
00005              Licensed under the BSD License, see licensing.txt.
00006 
00007     The maintainer of this library is James Turk (jturk@conceptofzero.net) 
00008          and the home of this Library is http://www.conceptofzero.net/
00009 *******************************************************************************/
00010 
00024 #ifndef __ze_zrect_h__
00025 #define __ze_zrect_h__
00026 
00027 #include "ZE_ZObject.h"        //included even though ZRect isn't derived (to obtain all other needed headers)
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 } //namspace ZE
00254 
00255 #endif //__ze_zrect_h__

Generated on Sat Dec 21 23:20:23 2002 for ZEngine by doxygen1.3-rc2