Main Page | Class Hierarchy | Class List | Directories | File List | Class Members | Related Pages

gcn::Rectangle Class Reference

#include <rectangle.hpp>

Inheritance diagram for gcn::Rectangle:

gcn::ClipRectangle List of all members.

Detailed Description

Represents a rectangle.

Definition at line 65 of file rectangle.hpp.

Public Member Functions

 Rectangle ()
 Constructor.
 Rectangle (int x, int y, int width, int height)
 Constructor.
void setAll (int x, int y, int width, int height)
 Sets the dimension of a rectangle.
bool intersect (const Rectangle &rectangle)
 Checks if another Rectangle intersects with the Rectangle.
bool isPointInRect (int x, int y) const
 Checks if a point is inside the Rectangle.

Public Attributes

int x
int y
int width
int height


Constructor & Destructor Documentation

gcn::Rectangle::Rectangle  ) 
 

Constructor.

Resets member variables.

Definition at line 63 of file rectangle.cpp.

gcn::Rectangle::Rectangle int  x,
int  y,
int  width,
int  height
 

Constructor.

Parameters:
x the Rectangle x coordinate.
y the Rectangle y coordinate.
width the Rectangle width.
height the Rectangle height.

Definition at line 71 of file rectangle.cpp.


Member Function Documentation

bool gcn::Rectangle::intersect const Rectangle rectangle  ) 
 

Checks if another Rectangle intersects with the Rectangle.

Parameters:
rectangle another Rectangle.

Definition at line 87 of file rectangle.cpp.

Referenced by gcn::SDLGraphics::fillRectangle(), and gcn::Graphics::pushClipArea().

bool gcn::Rectangle::isPointInRect int  x,
int  y
const
 

Checks if a point is inside the Rectangle.

Parameters:
x the point x coordinate
y the point y coordinate

Definition at line 128 of file rectangle.cpp.

Referenced by gcn::SDLGraphics::drawLine(), gcn::SDLGraphics::drawPoint(), and gcn::Gui::logic().

void gcn::Rectangle::setAll int  x,
int  y,
int  width,
int  height
 

Sets the dimension of a rectangle.

Parameters:
x the Rectangle x coordinate,
y the Rectangle y coordinate,
width the Rectangle width,
height the Rectangle height,

Definition at line 79 of file rectangle.cpp.


The documentation for this class was generated from the following files:
Generated on Tue May 17 21:23:26 2005 for Guichan by  doxygen 1.4.1