How to recognize the touch of a non regular sprite image ?

Posted by srikanth rongali on Stack Overflow See other posts from Stack Overflow or by srikanth rongali
Published on 2010-03-23T03:59:24Z Indexed on 2010/03/23 4:01 UTC
Read the original article Hit count: 287

I have a sprite and if it is touched the touch should be recognized. I used the coordinates to do so. I took the coordinates (min x, min y, max x , max y)of the sprite image. But The sprite image is not a rectangular shape. So, even if I touch the coordinates outside the sprite and inside the rectangular bounds the sprite is recognized. But for my application I need only the sprite to be recognized. So, I have to take only the coordinates of the sprite, but it is not regular shape. I am using CCSprite in my program.

So, what can I do to for only the sprite to be selected ? Which classes should use for this? Thank You.

© Stack Overflow or respective owner

Related posts about cocoa-touch

Related posts about cocos2d