次のコードを使用してスプライトを回転させていますが、回転速度が非常に速く、指の回転と同期していません。
init メソッドでは、次のコードを記述しました
UIRotationGestureRecognizer* rot = [[UIRotationGestureRecognizer alloc] initWithTarget:self action: @selector (rotateSelector:)];
[[[CCDirector sharedDirector] openGLView] addGestureRecognizer:rot];
セレクターの実装を以下に記述します。
- (void)rotateSelector: (UIRotationGestureRecognizer*) gestureRecognizer
{
rotation = CC_RADIANS_TO_DEGREES([gestureRecognizer rotation]);
mySprite.rotation += rotation;
}
問題は次の行にあると思います mySprite.rotation += rotation;
しかし、CCSprite の回転を指の回転と同期させる方法がわかりません。