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

Public Member Functions | Public Attributes | List of all members
gcn::Rectangle Class Reference

#include <rectangle.h>

Inheritance diagram for gcn::Rectangle:
gcn::ClipRectangle

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

◆ Rectangle() [1/2]

gcn::Rectangle::Rectangle ( )

Constructor. Resets member variables.

◆ Rectangle() [2/2]

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

Constructor.

Parameters
xthe Rectangle x coordinate.
ythe Rectangle y coordinate.
widththe Rectangle width.
heightthe Rectangle height.

Member Function Documentation

◆ intersect() [1/2]

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

Checks if another Rectangle intersects with the Rectangle.

Parameters
rectangleanother Rectangle.

◆ intersect() [2/2]

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

◆ isPointInRect()

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

Checks if a point is inside the Rectangle.

Parameters
xthe point x coordinate
ythe point y coordinate

◆ setAll()

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

Sets the dimension of a rectangle.

Parameters
xthe Rectangle x coordinate,
ythe Rectangle y coordinate,
widththe Rectangle width,
heightthe Rectangle height,

Member Data Documentation

◆ height

int gcn::Rectangle::height

◆ width

int gcn::Rectangle::width

◆ x

int gcn::Rectangle::x

◆ y

int gcn::Rectangle::y

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