4

I want to move a image to the right or to the left with the swipe gesture recognizer, i´m already moving the image using the CCMoveTo function, but I don´t know how move the image faster or slower depends of the force of the swipe.

If the user make a strong swipe the image should move faster than if the user make a soft swipe.

Anyone have any advice?

4

2 に答える 2

9

AUISwipeGestureRecognizerは一発モノ。デバイスがジェスチャーを検出すると起動し、その後実行されます。

指の動きに関する詳細情報が必要な場合は、UIPanGestureRecognizerを確認してください。

于 2012-09-25T20:43:43.900 に答える
5

それが のプロパティvelocityUIPanGestureRecognizer目的です。Paul Hegarty による cs193p のクラス 08 (と思われる) での使用例を見ることができます。iTunes Uからのダウンロードリンクはこちら

于 2012-09-25T23:47:15.107 に答える