【发布时间】:2015-02-01 04:11:10
【问题描述】:
我想创建一个SKSpriteNode,如上所述。我尝试过UIBezierPath,但XCode 无法识别用于创建该类型对象的函数。我想我可能需要import 一些东西,但我不确定是什么。
当我执行以下操作时,
我收到错误:Missing argument in call: center
但是,一旦我添加了适当的参数,
我就会收到错误:Extra argument 'edgeLoopFromPath' in call。
我的代码如下:
let circlePath: UIBezierPath = UIBezierPath(arcCenter: CGPointMake(self.frame.midX, self.frame.midY), radius: self.frame.height / 2, startAngle: 0, endAngle: 360, clockwise: true)
let confinCircle: SKPhysicsBody = SKPhysicsBody(center: CGPointMake(self.frame.midX, self.frame.midY), edgeLoopFromPath: circlePath)
【问题讨论】:
-
你应该发布你试图用来创建 UIBezierPath 的代码
-
@AbhiBeckert 代码已启动,还有错误消息。
-
检查 skphysicsbody 类参考或让 xcode 自动完成指导你,看起来你的参数顺序错误,edgeLoopFromPath 应该是第一个参数 afaik
标签: ios swift sprite-kit uibezierpath skspritenode