cocos2d-x  3.3
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Rect Class Reference

#include <CCGeometry.h>

Public Member Functions

 Rect ()
 Rect (float x, float y, float width, float height)
 Rect (const Rect &other)
Rectoperator= (const Rect &other)
void setRect (float x, float y, float width, float height)
float getMinX () const
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 Rect &rect) const
 return the topmost y-value of current rect More...
 
bool containsPoint (const Vec2 &point) const
bool intersectsRect (const Rect &rect) const
Rect unionWithRect (const Rect &rect) const
void merge (const Rect &rect)

Public Attributes

Vec2 origin
Size size

Static Public Attributes

static const Rect ZERO

Constructor & Destructor Documentation

Rect ( )
Rect ( float  x,
float  y,
float  width,
float  height 
)
Rect ( const Rect other)

Member Function Documentation

bool containsPoint ( const Vec2 point) const
bool equals ( const Rect rect) const

return the topmost y-value of current rect

float getMaxX ( ) const

return the midpoint x-value of current rect

float getMaxY ( ) const

return the midpoint y-value of current rect

float getMidX ( ) const

return the leftmost x-value of current rect

float getMidY ( ) const

return the bottommost y-value of current rect

float getMinX ( ) const
float getMinY ( ) const

return the rightmost x-value of current rect

bool intersectsRect ( const Rect rect) const
void merge ( const Rect rect)
Rect& operator= ( const Rect other)
void setRect ( float  x,
float  y,
float  width,
float  height 
)
Rect unionWithRect ( const Rect rect) const

Member Data Documentation

Vec2 origin
Size size
const Rect ZERO
static

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