如何将这行代码转换为swift,我正在尝试使精灵沿着一条环形路径运行
如何将此行代码转换为swift:如何将这行代码转换为swift,我正在尝试使精灵沿着一条环形路径运行,swift,sprite-kit,uibezierpath,skaction,Swift,Sprite Kit,Uibezierpath,Skaction,如何将此行代码转换为swift: // circle path UIBezierPath *circle = [UIBezierPath bezierPathWithRoundedRect:CGRectMake(0, 0, 100, 100) cornerRadius:100]; SKAction *followCircle = [SKAction followPath:circle.CGPath asOffset:YES orientToPath:NO duration:5.0
// circle path
UIBezierPath *circle = [UIBezierPath bezierPathWithRoundedRect:CGRectMake(0, 0, 100, 100) cornerRadius:100];
SKAction *followCircle = [SKAction followPath:circle.CGPath asOffset:YES orientToPath:NO duration:5.0];
正如您所看到的,代码非常相似,只是语法不同
祝你玩得开心
let circle = UIBezierPath(roundedRect: CGRectMake(0, 0, 100, 100), cornerRadius: 100)
let followCircle = SKAction.followPath(circle.CGPath, asOffset: true, orientToPath: false, duration: 5.0)