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 
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 } //namespace ZE
00265 
00266 #endif //__ze_zrect_h__

Generated on Sun Jun 29 14:13:51 2003 for ZEngine by doxygen1.3