@ js NA
More...
Files
Namespaces
Classes
Visitor that helps to perform action that depends on polymorphic object type.
More...
Macros
A convenience macro to iterate over a CCArray using.
More...
#define
CCPointMake(x, y) CCPoint((float)(x), (float)(y))
#define
CCSizeMake(width, height) CCSize((float)(width), (float)(height))
#define
CCRectMake(x, y, width, height) CCRect((float)(x), (float)(y), (float)(width), (float)(height))
Helper macro that creates a CCPoint.
More...
Typedefs
Functions
CCRect
CC_DLL (const char *pszContent)
Returns a Core Graphics rectangle structure corresponding to the data in a given string.
More...
CCPoint
CC_DLL (const float a)
Converts radians to a normalized vector.
More...
var ( var a)
Converts radians to a normalized vector.
More...
local ( local a)
Converts radians to a normalized vector.
More...
float
CC_DLL (float value, float min_inclusive, float max_inclusive)
Clamp a value between from and to.
More...
local ( local value, local min_inclusive, local max_inclusive)
Clamp a value between from and to.
More...
CCPoint
CC_DLL (const CCPoint &p, const CCPoint &from, const CCPoint &to)
Clamp a point between from and to.
More...
var ( var p, var from, var to)
Clamp a point between from and to.
More...
local ( local p, local from, local to)
Clamp a point between from and to.
More...
CCPoint
CC_DLL (const CCSize &s)
var ( var s)
local ( local s)
CCPoint
CC_DLL (const CCPoint &p, float(*opFunc)(float))
Run a math operation function on each point component absf, fllorf, ceilf, roundf any function that has the signature: float func(float); For example: let's try to take the floor of x,y ccpCompOp(p,floorf);.
More...
var ( var p)
Run a math operation function on each point component absf, fllorf, ceilf, roundf any function that has the signature: float func(float); For example: let's try to take the floor of x,y ccpCompOp(p,floorf);.
More...
local ( local p)
Run a math operation function on each point component absf, fllorf, ceilf, roundf any function that has the signature: float func(float); For example: let's try to take the floor of x,y ccpCompOp(p,floorf);.
More...
CCPoint
CC_DLL (const CCPoint &a, const CCPoint &b, float alpha)
Linear Interpolation between two points a and b.
More...
bool
CC_DLL (const CCPoint &p1, const CCPoint &p2, const CCPoint &p3, const CCPoint &p4, float *s, float *t)
A general line-line intersection test.
More...
bool
CC_DLL (const CCPoint &A, const CCPoint &B, const CCPoint &C, const CCPoint &D)
void
CC_DLL (CCPoint *points, float stroke,
ccVertex2F *vertices, unsigned int offset, unsigned int nuPoints)
converts a line to a polygon
More...
var ( var points, var stroke, var vertices, var offset, var nuPoints)
converts a line to a polygon
More...
local ( local points, local stroke, local vertices, local offset, local nuPoints)
converts a line to a polygon
More...
bool
CC_DLL (float Ax, float Ay, float Bx, float By, float Cx, float Cy, float Dx, float Dy, float *T)
returns whether or not the line intersects
More...
var ( var Ax, var Ay, var Bx, var By, var Cx, var Cy, var Dx, var Dy, var T)
returns whether or not the line intersects
More...
local ( local Ax, local Ay, local Bx, local By, local Cx, local Cy, local Dx, local Dy, local T)
returns whether or not the line intersects
More...
Variables
const CCPoint
CCPointZero = CCPoint((float)( 0 ), (float)( 0 ))
const CCSize
CCSizeZero = CCSize((float)( 0 ), (float)( 0 ))
var
CCSizeZero = CCSize((float)( 0 ), (float)( 0 ))
local
CCSizeZero = CCSize((float)( 0 ), (float)( 0 ))
const CCRect
CCRectZero = CCRect((float)( 0 ), (float)( 0 ), (float)( 0 ), (float)( 0 ))
Detailed Description
@ js NA
Macro Definition Documentation
#define
arrayMakeObjectsPerformSelector
(
pArray,
func,
elementType
)
Value:do { \
if(pArray && pArray->count() > 0) \
{ \
{ \
elementType pNode = (elementType) child; \
if(pNode) \
{ \
pNode->func(); \
} \
} \
} \
} \
while(false)
#define CCARRAY_FOREACH(__array__, __object__)
A convenience macro to iterate over a CCArray using.
Definition: CCArray.h:51
#define
arrayMakeObjectsPerformSelectorWithObject
(
pArray,
func,
pObject,
elementType
)
Value:do { \
if(pArray && pArray->count() > 0) \
{ \
CCObject* child =
NULL;
\
{ \
elementType pNode = (elementType) child; \
if(pNode) \
{ \
pNode->func(pObject); \
} \
} \
} \
} \
while(false)
#define CCARRAY_FOREACH(__array__, __object__)
A convenience macro to iterate over a CCArray using.
Definition: CCArray.h:51
#define CCARRAY_FOREACH
(
__array__,
__object__
)
Value:if ((__array__) && (__array__)->data->num > 0) \
for(CCObject** __arr__ = (__array__)->data->arr, **__end__ = (__array__)->data->arr + (__array__)->data->num-1; \
__arr__ <= __end__ && (((__object__) = *__arr__) !=
NULL /* || true*/); \
__arr__++)
A convenience macro to iterate over a CCArray using.
It is faster than the "fast enumeration" interface.
- Since
- v0.99.4
var CCARRAY_FOREACH
(
var,
var
)
Value:if ((__array__) && (__array__)->data->num > 0) \
for(CCObject** __arr__ = (__array__)->data->arr, **__end__ = (__array__)->data->arr + (__array__)->data->num-1; \
__arr__ <= __end__ && (((__object__) = *__arr__) !=
NULL /* || true*/); \
__arr__++)
A convenience macro to iterate over a CCArray using.
It is faster than the "fast enumeration" interface.
- Since
- v0.99.4
local CCARRAY_FOREACH
(
local,
local
)
Value:if ((__array__) && (__array__)->data->num > 0) \
for(CCObject** __arr__ = (__array__)->data->arr, **__end__ = (__array__)->data->arr + (__array__)->data->num-1; \
__arr__ <= __end__ && (((__object__) = *__arr__) !=
NULL /* || true*/); \
__arr__++)
A convenience macro to iterate over a CCArray using.
It is faster than the "fast enumeration" interface.
- Since
- v0.99.4
#define CCARRAY_FOREACH_REVERSE
(
__array__,
__object__
)
Value:if ((__array__) && (__array__)->data->num > 0) \
for(CCObject** __arr__ = (__array__)->data->arr + (__array__)->data->num-1, **__end__ = (__array__)->data->arr; \
__arr__ >= __end__ && (((__object__) = *__arr__) !=
NULL /* || true*/); \
__arr__--)
var CCARRAY_FOREACH_REVERSE
(
var,
var
)
Value:if ((__array__) && (__array__)->data->num > 0) \
for(CCObject** __arr__ = (__array__)->data->arr + (__array__)->data->num-1, **__end__ = (__array__)->data->arr; \
__arr__ >= __end__ && (((__object__) = *__arr__) !=
NULL /* || true*/); \
__arr__--)
local CCARRAY_FOREACH_REVERSE
(
local,
local
)
Value:if ((__array__) && (__array__)->data->num > 0) \
for(CCObject** __arr__ = (__array__)->data->arr + (__array__)->data->num-1, **__end__ = (__array__)->data->arr; \
__arr__ >= __end__ && (((__object__) = *__arr__) !=
NULL /* || true*/); \
__arr__--)
#define CCARRAY_VERIFY_TYPE
(
__array__,
__type__
)
void(0)
var CCARRAY_VERIFY_TYPE
(
var,
var
)
void(0)
local CCARRAY_VERIFY_TYPE
(
local,
local
)
void(0)
#define CCDICT_FOREACH
(
__dict__,
__el__
)
Value:CCDictElement* pTmp##__dict__##__el__ =
NULL; \
if (__dict__) \
HASH_ITER(hh, (__dict__)->m_pElements, __el__, pTmp##__dict__##__el__)
@
#define ccp
(
__X__,
__Y__
Helper macro that creates a CCPoint.
- Returns
- CCPoint
- Since
- v0.7.2
Helper macro that creates a CCPoint.
- Returns
- CCPoint
- Since
- v0.7.2
#define CCPointMake
(
x,
y
)
CCPoint((float)(x), (float)(y))
var CCPointMake
(
var,
var
)
CCPoint((float)(x), (float)(y))
local CCPointMake
(
local,
local
)
CCPoint((float)(x), (float)(y))
#define CCRectMake
(
x,
y,
width,
height
)
CCRect((float)(x), (float)(y), (float)(width), (float)(height))
var CCRectMake
(
var,
var,
var,
var
)
CCRect((float)(x), (float)(y), (float)(width), (float)(height))
local CCRectMake
(
local,
local,
local,
local
)
CCRect((float)(x), (float)(y), (float)(width), (float)(height))
#define CCSizeMake
(
width,
height
)
CCSize((float)(width), (float)(height))
var CCSizeMake
(
var,
var
)
CCSize((float)(width), (float)(height))
local CCSizeMake
(
local,
local
)
CCSize((float)(width), (float)(height))
#define CCStringMake
(
str )
CCString::create(str)
var CCStringMake
(
var )
CCString::create(str)
local CCStringMake
(
local )
CCString::create(str)
Typedef Documentation
typedef std::set<CCObject *>
::iterator CCSetIterator
Function Documentation
void
CC_DLL
cocos2d::ccVertexLineToPolygon
(
CCPoint *
points,
float
stroke,
unsigned int
offset,
unsigned int
nuPoints
)
converts a line to a polygon
var ccVertexLineToPolygon
(
var
points,
var
stroke,
var
vertices,
var
offset,
var
nuPoints
)
converts a line to a polygon
local ccVertexLineToPolygon
(
local
points,
local
stroke,
local
vertices,
local
offset,
local
nuPoints
)
converts a line to a polygon
bool
CC_DLL
cocos2d::ccVertexLineIntersect
(
float
Ax,
float
Ay,
float
Bx,
float
By,
float
Cx,
float
Cy,
float
Dx,
float
Dy,
float *
T
)
returns whether or not the line intersects
var ccVertexLineIntersect
(
var
Ax,
var
Ay,
var
Bx,
var
By,
var
Cx,
var
Cy,
var
Dx,
var
Dy,
var
T
)
returns whether or not the line intersects
local ccVertexLineIntersect
(
local
Ax,
local
Ay,
local
Bx,
local
By,
local
Cx,
local
Cy,
local
Dx,
local
Dy,
local
T
)
returns whether or not the line intersects
CCRect
CC_DLL
cocos2d::CCRectFromString
(
const char *
pszContent )
Returns a Core Graphics rectangle structure corresponding to the data in a given string.
- Parameters
-
pszContent A string object whose contents are of the form "{{x,y},{w, h}}", where x is the x coordinate, y is the y coordinate, w is the width, and h is the height. These components can represent integer or float values. An example of a valid string is "{{3,2},{4,5}}". The string is not localized, so items are always separated with a comma.
- Returns
- A Core Graphics structure that represents a rectangle. If the string is not well-formed, the function returns CCRectZero.
var CCRectFromString
(
var
pszContent )
Returns a Core Graphics rectangle structure corresponding to the data in a given string.
- Parameters
-
pszContent A string object whose contents are of the form "{{x,y},{w, h}}", where x is the x coordinate, y is the y coordinate, w is the width, and h is the height. These components can represent integer or float values. An example of a valid string is "{{3,2},{4,5}}". The string is not localized, so items are always separated with a comma.
- Returns
- A Core Graphics structure that represents a rectangle. If the string is not well-formed, the function returns CCRectZero.
local CCRectFromString
(
local
pszContent )
Returns a Core Graphics rectangle structure corresponding to the data in a given string.
- Parameters
-
pszContent A string object whose contents are of the form "{{x,y},{w, h}}", where x is the x coordinate, y is the y coordinate, w is the width, and h is the height. These components can represent integer or float values. An example of a valid string is "{{3,2},{4,5}}". The string is not localized, so items are always separated with a comma.
- Returns
- A Core Graphics structure that represents a rectangle. If the string is not well-formed, the function returns CCRectZero.
CCPoint
CC_DLL cocos2d::ccpForAngle
(
const float
a )
Converts radians to a normalized vector.
- Returns
- CCPoint
- Since
- v0.7.2
var ccpForAngle
(
var
a )
Converts radians to a normalized vector.
- Returns
- CCPoint
- Since
- v0.7.2
local ccpForAngle
(
local
a )
Converts radians to a normalized vector.
- Returns
- CCPoint
- Since
- v0.7.2
float
CC_DLL cocos2d::clampf
(
float
value,
float
min_inclusive,
float
max_inclusive
)
Clamp a value between from and to.
- Since
- v0.99.1
var clampf
(
var
value,
var
min_inclusive,
var
max_inclusive
)
Clamp a value between from and to.
- Since
- v0.99.1
local clampf
(
local
value,
local
min_inclusive,
local
max_inclusive
)
Clamp a value between from and to.
- Since
- v0.99.1
CCPoint
CC_DLL cocos2d::ccpClamp
(
const CCPoint &
p,
const CCPoint &
from,
const CCPoint &
to
)
Clamp a point between from and to.
- Since
- v0.99.1
var ccpClamp
(
var
p,
var
from,
var
to
)
Clamp a point between from and to.
- Since
- v0.99.1
local ccpClamp
(
local
p,
local
from,
local
to
)
Clamp a point between from and to.
- Since
- v0.99.1
CCPoint
CC_DLL cocos2d::ccpFromSize
(
const CCSize &
s )
var ccpFromSize
(
var
s )
local ccpFromSize
(
local
s )
CCPoint
CC_DLL cocos2d::ccpCompOp
(
const CCPoint &
p,
float(*)(float)
opFunc
)
Run a math operation function on each point component absf, fllorf, ceilf, roundf any function that has the signature: float func(float); For example: let's try to take the floor of x,y ccpCompOp(p,floorf);.
- Since
- v0.99.1
var ccpCompOp
(
var
p,
var
opFunc
)
Run a math operation function on each point component absf, fllorf, ceilf, roundf any function that has the signature: float func(float); For example: let's try to take the floor of x,y ccpCompOp(p,floorf);.
- Since
- v0.99.1
local ccpCompOp
(
local
p,
local
opFunc
)
Run a math operation function on each point component absf, fllorf, ceilf, roundf any function that has the signature: float func(float); For example: let's try to take the floor of x,y ccpCompOp(p,floorf);.
- Since
- v0.99.1
CCPoint
CC_DLL cocos2d::ccpLerp
(
const CCPoint &
a,
const CCPoint &
b,
float
alpha
)
Linear Interpolation between two points a and b.
- Returns
- alpha == 0 ? a alpha == 1 ? b otherwise a value between a..b
- Since
- v0.99.1
var ccpLerp
(
var
a,
var
b,
var
alpha
)
Linear Interpolation between two points a and b.
- Returns
- alpha == 0 ? a alpha == 1 ? b otherwise a value between a..b
- Since
- v0.99.1
local ccpLerp
(
local
a,
local
b,
local
alpha
)
Linear Interpolation between two points a and b.
- Returns
- alpha == 0 ? a alpha == 1 ? b otherwise a value between a..b
- Since
- v0.99.1
bool
CC_DLL
cocos2d::ccpLineIntersect
(
const CCPoint &
p1,
const CCPoint &
p2,
const CCPoint &
p3,
const CCPoint &
p4,
float *
s,
float *
t
)
A general line-line intersection test.
- Parameters
-
p1 is the startpoint for the first line P1 = (p1 - p2)
p2 is the endpoint for the first line P1 = (p1 - p2)
p3 is the startpoint for the second line P2 = (p3 - p4)
p4 is the endpoint for the second line P2 = (p3 - p4)
s is the range for a hitpoint in P1 (pa = p1 + s*(p2 - p1))
t is the range for a hitpoint in P3 (pa = p2 + t*(p4 - p3))
- Returns
- bool indicating successful intersection of a line note that to truly test intersection for segments we have to make sure that s & t lie within [0..1] and for rays, make sure s & t > 0 the hit point is p3 + t * (p4 - p3); the hit point also is p1 + s * (p2 - p1);
- Since
- v0.99.1
var ccpLineIntersect
(
var
p1,
var
p2,
var
p3,
var
p4,
var
s,
var
t
)
A general line-line intersection test.
- Parameters
-
p1 is the startpoint for the first line P1 = (p1 - p2)
p2 is the endpoint for the first line P1 = (p1 - p2)
p3 is the startpoint for the second line P2 = (p3 - p4)
p4 is the endpoint for the second line P2 = (p3 - p4)
s is the range for a hitpoint in P1 (pa = p1 + s*(p2 - p1))
t is the range for a hitpoint in P3 (pa = p2 + t*(p4 - p3))
- Returns
- bool indicating successful intersection of a line note that to truly test intersection for segments we have to make sure that s & t lie within [0..1] and for rays, make sure s & t > 0 the hit point is p3 + t * (p4 - p3); the hit point also is p1 + s * (p2 - p1);
- Since
- v0.99.1
local ccpLineIntersect
(
local
p1,
local
p2,
local
p3,
local
p4,
local
s,
local
t
)
A general line-line intersection test.
- Parameters
-
p1 is the startpoint for the first line P1 = (p1 - p2)
p2 is the endpoint for the first line P1 = (p1 - p2)
p3 is the startpoint for the second line P2 = (p3 - p4)
p4 is the endpoint for the second line P2 = (p3 - p4)
s is the range for a hitpoint in P1 (pa = p1 + s*(p2 - p1))
t is the range for a hitpoint in P3 (pa = p2 + t*(p4 - p3))
- Returns
- bool indicating successful intersection of a line note that to truly test intersection for segments we have to make sure that s & t lie within [0..1] and for rays, make sure s & t > 0 the hit point is p3 + t * (p4 - p3); the hit point also is p1 + s * (p2 - p1);
- Since
- v0.99.1
bool
CC_DLL
cocos2d::ccpSegmentIntersect
(
const CCPoint &
A,
const CCPoint &
B,
const CCPoint &
C,
const CCPoint &
D
)
Variable Documentation
const CCPoint CCPointZero = CCPoint((float)( 0 ), (float)( 0 ))
var CCPointZero = CCPoint((float)( 0 ), (float)( 0 ))
local CCPointZero = CCPoint((float)( 0 ), (float)( 0 ))
const CCRect CCRectZero = CCRect((float)( 0 ), (float)( 0 ), (float)( 0 ), (float)( 0 ))
var CCRectZero = CCRect((float)( 0 ), (float)( 0 ), (float)( 0 ), (float)( 0 ))
local CCRectZero = CCRect((float)( 0 ), (float)( 0 ), (float)( 0 ), (float)( 0 ))
const CCSize CCSizeZero = CCSize((float)( 0 ), (float)( 0 ))
var CCSizeZero = CCSize((float)( 0 ), (float)( 0 ))
local CCSizeZero = CCSize((float)( 0 ), (float)( 0 ))