Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

I'm creating a space cocos2d game with objetive-c. I have in the bottom left 2 arrows to move the sprite left or right. I also implemented a swipe gesture to change weapon, however it only happens when I'm not touching the screen.

I would like the player to change weapons while he's moving the sprite and not have to lift the finger from the arrows and stop moving the sprite to change weapons.

Is there any way I can detect Gestures while having a finger pressed un a buton in thes screen?

share|improve this question

1 Answer 1

up vote 0 down vote accepted

If you want to rely just on UIGestureRecognizers you will have to use a UIPanGestureRecognizer, it will be able to recognize when the user is moving the finger without having to lift it. It does recognizes every movement done after starting holding the finger on the screen.

Of course you will have to cheat a little bit to manage both it and the movement but it will be feasible.

share|improve this answer
    
I finally decided to reduce the touch rectangle so it dosn't interdere with my control buttons. But anyway thanks. –  marcg11 Apr 3 '12 at 9:47

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.