【一】:函数
//1.设置绘制颜色
1.ccDrawColor4B("红","绿","蓝","透明");
//2.设置绘制线宽
2.glLineWidth(线条宽度);
//3.绘制一条直线
3.ccDrawLine("起点坐标","终点坐标");
//4.设置点的大小
4.ccPointSize("半径");
//5.绘制一个点
5.[1]ccDrawPoint("点的坐标");
5.[2]ccDrawPoints("点的坐标数组","数量");
//6.绘制一个圆形
6.[1]ccDrawCircle("中心点坐标","半径f","角度f","分段数","显示半径","X轴放大倍数f","Y轴放大倍数f");
6.[2]ccDrawCircle("中心点坐标","半径f","角度f","分段数","显示半径");
//7.绘制空心多边形
7.ccDrawPoly("顶点数组","点数量","是否自动封闭");
//8.绘制实心多边形
8.ccDrawSolidPoly("顶点数组","点数量","颜色4F");
//9.绘制填充矩形
9.ccDrawSolidRect("对角顶点1","对角顶点2","颜色4F");
//10.绘制空心矩形
10.ccDrawRect("对角顶点1","对角顶点2");
//11.绘制平面贝赛尔曲线
11.ccDrawQuadBezier("起始点","控制点","结束点","分段数");
//12.绘制立体贝赛尔曲线
12.ccDrawCubicBezier("起始点","控制点1","控制点2","结束点","分段数");
颜色:
ccDrawColor4B("红f","绿f","蓝f","透明f");//红、绿、蓝、透明、满值均为255
ccDrawColor4F("红f","绿f","蓝f","透明f");//红、绿、蓝、满值均为255,透明满值为1
需要重写draw函数
virtual void draw();
Test