How can I make swipe gestures in cocos2d
iphone/ipad in all directions? When swipe touches (passes at) on a sprite I want to perform a function at that time, like i want to cut that object when swipe at that sprite.
Asked
Active
Viewed 4,067 times
3

Janak Nirmal
- 22,706
- 18
- 63
- 99

Burhan Ahmad
- 728
- 5
- 13
2 Answers
3
You should look for cocos2d and gesture recognizer. Check this post
cocos2d-iOS - Gesture recognisers
and google will help too...

Community
- 1
- 1

Sebastián Castro
- 1,408
- 10
- 28
1
UISwipeGestureRecognizer
might give you a problem because it only supplies you with the coordinates of the place where the swipe started (it only calls a handler once per swipe).
I would use UIPanGestureRecognizer
. This calls a handler every time the pan is updated (i.e. every time the finger moves during the swipe). You can then figure out which sprite your pan/swipe is passing over.

Danyal Aytekin
- 4,106
- 3
- 36
- 44
-
1thanks a lot for your kind help can you give me some code example please – Burhan Ahmad May 29 '12 at 08:20