cocos2dx两种绘图方式:CCDrawingPrimitives和CCDrawNode。它们都在cocos2dxdraw_nodes目录下。
- CCDrawingPrimitives(原生绘图)必须在节点的draw函数中调用:
void CC_DLL ccDrawPoint()
void CC_DLL ccDrawLine()
void CC_DLL ccDrawLine()
void CC_DLL ccDrawCubicBezier(const CCPoint& origin, const CCPoint& control1, const CCPoint& control2, const CCPoint& destination, unsigned int segments);
- CCDrawNode(绘图节点)不需要在draw函数中调用,必须addChild才能在页面中显示
void drawPolygon(CCPoint *verts, unsigned int count, const ccColor4F &fillColor, float borderWidth, const ccColor4F &borderColor);