【发布时间】:2016-10-07 20:57:47
【问题描述】:
我正在围绕使用此代码创建的圆圈移动我的 sknode:
circleDiameter = 300;
pathCenterPoint = CGPointMake(self.position.x - circleDiameter/2, self.position.y - circleDiameter/2);
UIBezierPath *circlePath = [UIBezierPath bezierPathWithRoundedRect:CGRectMake(pathCenterPoint.x, pathCenterPoint.y, circleDiameter, circleDiameter) cornerRadius:circleDiameter/2];
self.actionClockwise = [SKAction followPath:circlePath.CGPath asOffset:false orientToPath:true duration:2];
self.circleActionForever = [SKAction repeatActionForever:self.actionClockwise];
[self runAction:self.actionCounterClockwise withKey:@"circleActionForever"];
一切正常。现在我希望当用户点击屏幕以恢复方向并逆时针移动节点时。我通过使用 .reversedAction 命令运行相同的操作来做到这一点。
但动作总是从起点重新开始。
我想知道是否有某种方法可以从用户点击屏幕时旧动画的位置开始动画?
【问题讨论】:
标签: objective-c xcode sprite-kit uibezierpath sknode