2
如何绘制多边形与从cocos2D框架中的NSMutableArray对象读取的点?在Cocos2D,iOS中绘制填充动态多边形
我可以使用此功能来绘制多边形:filled antialiased poly cocos2d
问题是becouse点参数*(CGPoint 波利)必须是静态的对象。
任何想法或建议吗?
如何绘制多边形与从cocos2D框架中的NSMutableArray对象读取的点?在Cocos2D,iOS中绘制填充动态多边形
我可以使用此功能来绘制多边形:filled antialiased poly cocos2d
问题是becouse点参数*(CGPoint 波利)必须是静态的对象。
任何想法或建议吗?
什么是NSMutableArray
类型的对象? 您需要提取点的原始数据并将其设置为poli
参数。 如果它是NSValue
与CGPoint
那么:
NSMutableArray* yourPointsArray;
...
CGPoint* poli = malloc (sizeof (CGPoint) * [yourPointsArray count]);
for (uint i=0; i<[yourPointsArray count]; i++)
{
poli[i] = [[yourPointsArray objectAtIndex: i] CGPointValue];
}
ccFillPoly (poli, [yourPointsArray count], YES);
free (poly);