2012-02-13 70 views

回答

3

什么是NSMutableArray类型的对象? 您需要提取点的原始数据并将其设置为poli参数。 如果它是NSValueCGPoint那么:

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);