CCDrawingPrimitives/CCDrawNode学习笔记

来源:互联网 发布:网络上粑粑什么意思 编辑:程序博客网 时间:2024/06/07 11:05
cocos2dx两种绘图方式:CCDrawingPrimitives和CCDrawNode。它们都在cocos2dxdraw_nodes目录下。

  1. CCDrawingPrimitives(原生绘图)必须在节点的draw函数中调用:
void CC_DLL ccDrawPoint()
void CC_DLL ccDrawLine()

void CC_DLL ccDrawCubicBezier(const CCPoint& origin, const CCPoint& control1, const CCPoint& control2, const CCPoint& destination, unsigned int segments);


  1. CCDrawNode(绘图节点)不需要在draw函数中调用,必须addChild才能在页面中显示

void drawPolygon(CCPoint *verts, unsigned int count, const ccColor4F &fillColor, float borderWidth, const ccColor4F &borderColor);



参考

0 0
原创粉丝点击