I have been reading thru the documentation however it is not immediatly clear to me how to draw a polygon using CGPath. All I need to do is to draw CGPath around something like this:
__
\ \
\ \
\__\
Could anyone please provide an snippet on how to do this?
Additionally I assume CGPathContainsPoint will help me determine if a point is inside such path?, or does the path have to be a solid drawing
Also how can i move the cgpath around? Is this as easy as changing something like the origin just like in cgrect?
Thank you.
-Oscar
You should do it like this:
Note here, the points is the array of points you want to draw the polygon for. So it should be circular path like: You are drawing a triangle of points
(x1, x2, x3)then you should pass into array(x1, x2, x3, x1).Hope this helps.