What's the best way to implement a pan-able zoomable game map with Cocos2d for iPhone. It would be like Mobile Safari except with a game map that doesn't fit completely on screen. Or like how it's done with Angry Birds, Cut the rope, etc.
This would not be a side scrolling game, just a fixed game area that you can zoom in/out of.
I'm new so if there are tutorials for this that would be great.
Thanks
You absolutely should not follow the advice by Joao Caxaria, who seems to have unnecessarily reimplemented the entire UIGestureRecognizer API himself!
You can simply use UIKit's available gesture recognizers and attach them to the sharedDirector's openGLView, as specified in the chosen answer in the link below. These allow for pan, pinch, tap etc. detection. You can even use a UILongPressGestureRecognizer to detect dragging.
cocos2d-iOS - Gesture recognisers
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