1
\$\begingroup\$

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?

\$\endgroup\$

1 Answer 1

0
\$\begingroup\$

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.

\$\endgroup\$
1
  • \$\begingroup\$ I finally decided to reduce the touch rectangle so it dosn't interdere with my control buttons. But anyway thanks. \$\endgroup\$
    – marcg11
    Apr 3, 2012 at 9:47

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .