Possible Duplicate:
Detect if CGPoint within polygon
I have the coordinates of a set of touches from a UIEvent
. Is there a way to check if they are contained within a certain shape -- a polygon -- that I can define?
I have experience in Java, and I would use the polygon
class and call the contains(int x, int y)
method. Is there a similar way to do this in Cocoa Touch?
If you define your polygon as a CGPath
, you can use CGPathContainsPoint()
... Can you tell us more about your application concept?
EDIT:
There's also the higher-level UIBezierPath
and/or NSBezierPath
.. both of those objects have a -containsPoint
method.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With