My Project
Public Member Functions | Public Attributes | Static Public Attributes | List of all members
ParaEngine::CCRect Class Reference

Public Member Functions

 CCRect ()
 Constructor an empty Rect. More...
 
 CCRect (float x, float y, float width, float height)
 Constructor a rect. More...
 
 CCRect (const CCVector2 &pos, const Size &dimension)
 Constructor a rect. More...
 
 CCRect (const CCRect &other)
 Copy constructor. More...
 
CCRectoperator= (const CCRect &other)
 NA NA
 
void setRect (float x, float y, float width, float height)
 Set the x, y, width and height of Rect. More...
 
float getMinX () const
 Get the left of the rect. More...
 
float getMidX () const
 return the leftmost x-value of current rect More...
 
float getMaxX () const
 return the midpoint x-value of current rect More...
 
float getMinY () const
 return the rightmost x-value of current rect More...
 
float getMidY () const
 return the bottommost y-value of current rect More...
 
float getMaxY () const
 return the midpoint y-value of current rect More...
 
bool equals (const CCRect &rect) const
 return the topmost y-value of current rect More...
 
bool containsPoint (const CCVector2 &point) const
 Check if the points is contained in the rect. More...
 
bool intersectsRect (const CCRect &rect) const
 Check the intersect status of two rects. More...
 
bool intersectsCircle (const CCVector2 &center, float radius) const
 Check the intersect status of the rect and a circle. More...
 
CCRect unionWithRect (const CCRect &rect) const
 Get the min rect which can contain this and rect. More...
 
void merge (const CCRect &rect)
 Compute the min rect which can contain this and rect, assign it to this. More...
 

Public Attributes

CCVector2 origin
 Low left point of rect. More...
 
Size size
 Width and height of the rect. More...
 

Static Public Attributes

static const CCRect ZERO = CCRect(0, 0, 0, 0)
 An empty Rect. More...
 

Constructor & Destructor Documentation

§ CCRect() [1/4]

CCRect::CCRect ( void  )

Constructor an empty Rect.

NA

§ CCRect() [2/4]

CCRect::CCRect ( float  x,
float  y,
float  width,
float  height 
)

Constructor a rect.

NA

§ CCRect() [3/4]

CCRect::CCRect ( const CCVector2 pos,
const Size dimension 
)

Constructor a rect.

NA

§ CCRect() [4/4]

CCRect::CCRect ( const CCRect other)

Copy constructor.

NA NA

Member Function Documentation

§ containsPoint()

bool CCRect::containsPoint ( const CCVector2 point) const

Check if the points is contained in the rect.

NA

§ equals()

bool CCRect::equals ( const CCRect rect) const

return the topmost y-value of current rect

Compare two rects. NA

§ getMaxX()

float CCRect::getMaxX ( ) const

return the midpoint x-value of current rect

Get the right of rect. NA

§ getMaxY()

float CCRect::getMaxY ( ) const

return the midpoint y-value of current rect

Get top of rect. NA

§ getMidX()

float CCRect::getMidX ( ) const

return the leftmost x-value of current rect

Get the X coordinate of center point. NA

§ getMidY()

float CCRect::getMidY ( ) const

return the bottommost y-value of current rect

Get the Y coordinate of center point. NA

§ getMinX()

float CCRect::getMinX ( ) const

Get the left of the rect.

NA

§ getMinY()

float CCRect::getMinY ( ) const

return the rightmost x-value of current rect

Get the bottom of rect. NA

§ intersectsCircle()

bool CCRect::intersectsCircle ( const CCVector2 center,
float  radius 
) const

Check the intersect status of the rect and a circle.

NA

§ intersectsRect()

bool CCRect::intersectsRect ( const CCRect rect) const

Check the intersect status of two rects.

NA

§ merge()

void CCRect::merge ( const CCRect rect)

Compute the min rect which can contain this and rect, assign it to this.

§ setRect()

void CCRect::setRect ( float  x,
float  y,
float  width,
float  height 
)

Set the x, y, width and height of Rect.

NA NA

§ unionWithRect()

CCRect CCRect::unionWithRect ( const CCRect rect) const

Get the min rect which can contain this and rect.

NA NA

Member Data Documentation

§ origin

CCVector2 ParaEngine::CCRect::origin

Low left point of rect.

§ size

Size ParaEngine::CCRect::size

Width and height of the rect.

§ ZERO

const CCRect CCRect::ZERO = CCRect(0, 0, 0, 0)
static

An empty Rect.


The documentation for this class was generated from the following files: