Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save tatsuro-ueda/3323843 to your computer and use it in GitHub Desktop.
Save tatsuro-ueda/3323843 to your computer and use it in GitHub Desktop.
カスタムな当たり判定を設定するには

##Create Custom button like human Hand

I think at first you have to make polygon which fit to your image. And then you can use touchesBegan:withEvent: to get the coordinate of touch point and judge whether the point is inside of polygon or not.

Here is similar question like yours.

http://stackoverflow.com/questions/8450967/how-to-get-particular-touch-area

I think this is a little difficult work, so maybe you would better use cocos2d library which have collision judgement function.

image

http://box2d.org/forum/viewtopic.php?f=9&t=7487

But also I think iOS is well constructed for handling touch, so this is beneficial effort for you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment