このホイールには 6 個あります。ホイールの上部が特定のポイントです。特定の点は駒の情報を与える。青い駒の情報が表示されるようになりました。したがって、たとえば紫色のピースをクリックすると、その紫色のピースが特定のポイントに移動し、紫色のピースに関する特定の情報に自動的に移動する必要があります。
CGFloat topPositionAngle = radiansToDegrees(atan2(view.transform.a, view.transform.b));
- -180-ピンク
- -120 - 青
- -60 - オレンジ
- 0 - 紫
- 60 - 黄
- 120 - 緑
これで topPositionAngle は -120 = 青を示し、紫が特定のポイントに来ると 0 を示します。
UITouch *touch = [touches anyObject];
CGPoint currentTouchPoint = [touch locationInView:view];
CGFloat currentAngle = radiansToDegrees(atan2(currentTouchPoint.x, currentTouchPoint.y));
CGFloat angleTransform = ???
CGAffineTransform current = view.transform;
[UIView animateWithDuration:0.2f animations:^{
[view setTransform:CGAffineTransformRotate(current, angleTransform)];
}];
特定のポイントへの自動回転を取得するにはどうすればよいですか? Dansk Bankアプリ (次の YouTube リンクを参照) のように、0:21 から 0:25 分のビデオに似たものがあります。