Touch: Non-rectangular Touch areas

2010-02-06 Thread Development
I have an app I am working on and several of the touch zones or buttons occur within a trapezoid. Because these trapezoids touch one another to complete a picture I need for the zones to be precise. What I'm not sure how to accomplish is allowing touch within the border of the trapezoid

Re: Touch: Non-rectangular Touch areas

2010-02-06 Thread Jens Alfke
On Feb 6, 2010, at 10:54 AM, Development wrote: I have an app I am working on and several of the touch zones or buttons occur within a trapezoid. Because these trapezoids touch one another to complete a picture I need for the zones to be precise. What I'm not sure how to accomplish

Re: Touch: Non-rectangular Touch areas

2010-02-06 Thread Andrew Farmer
On 6 Feb 2010, at 11:05, Jens Alfke wrote: The easiest way to do this is to create an NSBezierPath in the shape of the trapezoid and call -containsPoint: on it; but IIRC, that class doesn't exist on iPhone. Fortunately the math for hit-testing convex polygons is pretty easy: check any

Re: Touch: Non-rectangular Touch areas

2010-02-06 Thread Paul Sanders
Sent: Saturday, February 06, 2010 7:19 PM Subject: Re: Touch: Non-rectangular Touch areas Another simple approach is to use an image to do hit testing. You can either create a bitmap image for each touchable area, or a single image with a different color for each target, then test the color

Re: Touch: Non-rectangular Touch areas

2010-02-06 Thread Henry McGilton (Boulevardier)
To: Jens Alfke j...@mooseyard.com Cc: cocoa-dev@lists.apple.com Sent: Saturday, February 06, 2010 7:19 PM Subject: Re: Touch: Non-rectangular Touch areas Another simple approach is to use an image to do hit testing. You can either create a bitmap image for each touchable area, or a single

Re: Touch: Non-rectangular Touch areas

2010-02-06 Thread Development
...@mooseyard.com Cc: cocoa-dev@lists.apple.com Sent: Saturday, February 06, 2010 7:19 PM Subject: Re: Touch: Non-rectangular Touch areas Another simple approach is to use an image to do hit testing. You can either create a bitmap image for each touchable area, or a single image

Re: Touch: Non-rectangular Touch areas

2010-02-06 Thread Kyle Sluder
On Sat, Feb 6, 2010 at 3:45 PM, Development developm...@fornextsoft.com wrote: I really like the sound of this solution. I've never worked with CGPaths, is that anything at all like NSBezierPath? because it seems like this might be the way to go. Can I use an Image to create a CGPath? No.

Re: Touch: Non-rectangular Touch areas

2010-02-06 Thread Henry McGilton (Boulevardier)
: Andrew Farmer andf...@gmail.com To: Jens Alfke j...@mooseyard.com Cc: cocoa-dev@lists.apple.com Sent: Saturday, February 06, 2010 7:19 PM Subject: Re: Touch: Non-rectangular Touch areas Another simple approach is to use an image to do hit testing. You can either create a bitmap image for each

Re: Touch: Non-rectangular Touch areas

2010-02-06 Thread Henry McGilton (Boulevardier)
On Feb 6, 2010, at 6:45 PM, Kyle Sluder wrote: On Sat, Feb 6, 2010 at 3:45 PM, Development developm...@fornextsoft.com wrote: I really like the sound of this solution. I've never worked with CGPaths, is that anything at all like NSBezierPath? because it seems like this might be the way to