所以我正在制作汽车的快速动画,我希望轮胎旋转并向前平移......但由于某种原因它们向前滑动但后来我添加了旋转它们的代码,现在它们旋转并随机跳跃 x来回定位,这非常令人困惑,我不知道发生了什么..我是否遗漏了所需的框架或其他东西?
- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib.
frame = [NSTimer scheduledTimerWithTimeInterval:1/40.f
target:self
selector:@selector(enterFrame)
userInfo:nil
repeats:YES];
}
-(void)enterFrame {
//spin += +0.5;
spin = 0.5;
//wheel.center = CGPointMake(wheel.center.x+0.5, wheel.center.y);
wheel.center = CGPointMake(wheel.center.x+spin, wheel.center.y);
//wheel.transform = CGAffineTransformMakeRotation(spin);
wheel.transform = CGAffineTransformRotate(wheel.transform, spin);
}