2011-06-14 14:31:25 +08:00
|
|
|
|
|
|
|
typedef float CGFloat;
|
|
|
|
|
2012-02-02 14:26:38 +08:00
|
|
|
class CCPoint
|
2011-06-14 14:31:25 +08:00
|
|
|
{
|
2012-02-02 14:26:38 +08:00
|
|
|
float x;
|
|
|
|
float y;
|
|
|
|
CCPoint();
|
|
|
|
CCPoint(float x, float y);
|
|
|
|
|
|
|
|
static bool CCPointEqualToPoint(const CCPoint& point1, const CCPoint& point2);
|
2011-06-14 14:31:25 +08:00
|
|
|
};
|
|
|
|
|
2012-02-02 14:26:38 +08:00
|
|
|
class CCSize
|
2011-06-14 14:31:25 +08:00
|
|
|
{
|
2012-02-02 14:26:38 +08:00
|
|
|
float width;
|
|
|
|
float height;
|
|
|
|
CCSize();
|
|
|
|
CCSize(float width, float height);
|
2011-06-14 14:31:25 +08:00
|
|
|
|
2012-02-02 14:26:38 +08:00
|
|
|
static bool CCSizeEqualToSize(const CCSize& size1, const CCSize& size2);
|
2011-06-14 14:31:25 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
class CCRect
|
|
|
|
{
|
2012-02-02 14:26:38 +08:00
|
|
|
CCPoint origin;
|
|
|
|
CCSize size;
|
|
|
|
CCRect();
|
|
|
|
CCRect(float x, float y, float width, float height);
|
|
|
|
|
|
|
|
static CGFloat CCRectGetMinX(const CCRect& rect);
|
|
|
|
static CGFloat CCRectGetMaxX(const CCRect& rect);
|
|
|
|
static CGFloat CCRectGetMidX(const CCRect& rect);
|
|
|
|
static CGFloat CCRectGetMinY(const CCRect& rect);
|
|
|
|
static CGFloat CCRectGetMaxY(const CCRect& rect);
|
|
|
|
static CGFloat CCRectGetMidY(const CCRect& rect);
|
|
|
|
static bool CCRectEqualToRect(const CCRect& rect1, const CCRect& rect2);
|
2011-06-14 14:31:25 +08:00
|
|
|
static bool CCRectContainsPoint(const CCRect& rect, const CCPoint& point);
|
2012-02-02 14:26:38 +08:00
|
|
|
static bool CCRectIntersectsRect(const CCRect& rectA, const CCRect& rectB);
|
2011-06-14 14:31:25 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
CCPoint CCPointMake(float x, float y);
|
|
|
|
CCSize CCSizeMake(float width, float height);
|
|
|
|
CCRect CCRectMake(float x, float y, float width,float height);
|