ios - Cocos2d v3: What do you pass into drawPolyWithVerts? -
i've looked @ documentation ccdrawnode, , method draw polygon is
- (void)drawpolywithverts:(const cgpoint *)verts count:(nsuinteger)count fillcolor:(cccolor *)fill borderwidth:(cgfloat)width bordercolor:(cccolor *)line
i'm confused (const cgpoint *)certs
parameter. thought cgpoint struct, , didn't need pointer.
also, i'm assuming you'll need series of points construct polygon, , thought cgpoint represented 1 point.
i've checked through cocos 2d programming guide , couldn't see method in there.
https://www.makegameswith.us/docs/#!/cocos2d/1.1/overview
i've check out cggeometry reference on apple's site, couldn't see there.
i think i'm missing basic c / objective-c, can't figure out.
my question
what pass drawpolywithverts:(const cgpoint *)verts
, , how make it?
as user667648 pointed out in comments, answer pass c array of cgpoints method.
example:
cgpoint polygon[4] = { cgpointmake(0, 0), cgpointmake(2, 0), cgpointmake(0, 7), cgpointmake(2, 25) };
Comments
Post a Comment