2012-02-13 100 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);