$treeview $search $mathjax
Stratagus  2.2.6
$projectbrief
$projectbrief
$searchbox
-->
         _________ __                 __
        /   _____//  |_____________ _/  |______     ____  __ __  ______
        \_____  \\   __\_  __ \__  \\   __\__  \   / ___\|  |  \/  ___/
        /        \|  |  |  | \// __ \|  |  / __ \_/ /_/  >  |  /\___ \
       /_______  /|__|  |__|  (____  /__| (____  /\___  /|____//____  >
               \/                  \/          \//_____/            \/
    ______________________                           ______________________
                          T H E   W A R   B E G I N S
           Stratagus - A free fantasy real time strategy game engine

gcn::Rectangle Class Reference

#include <rectangle.h>

Inheritance diagram for gcn::Rectangle:

gcn::ClipRectangle

List of all members.


Public Member Functions

 Rectangle ()
 Rectangle (int x, int y, int width, int height)
void setAll (int x, int y, int width, int height)
bool intersect (const Rectangle &rectangle)
bool intersect (const Rectangle &rectangle) const
bool isPointInRect (int x, int y) const

Public Attributes

int x
int y
int width
int height

Detailed Description

Represents a rectangle.

Constructor & Destructor Documentation

gcn::Rectangle::Rectangle (  ) 

Constructor. Resets member variables.

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.


Member Function Documentation

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,

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

Checks if another Rectangle intersects with the Rectangle.

Parameters:
rectangle another Rectangle.

bool gcn::Rectangle::intersect ( const Rectangle rectangle  )  const [inline]

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


Member Data Documentation


The documentation for this class was generated from the following files:
(C) Copyright 1998-2011 by The Stratagus Project under the GNU General Public License.
All trademarks and copyrights on this page are owned by their respective owners.