大家好我在xcode 6 beta 3中使用swift和sprite-kit制作应用程序,一切正常。代码应该绘制一条平滑的红线。现在我下载了xcode 6 beta 4并且我的代码无法正常工作,我遇到的问题是我的线条不再平滑,并且存在空白。我已阅读苹果发行说明,但我找不到任何可以解释为什么我的代码无法正常工作的内容。
func drawLines() {
CGPathMoveToPoint(path, nil, location.x, location.y)
var locationX: CGFloat = location.x
var locationY: CGFloat = location.y
CGPathAddLineToPoint(path, nil, self.frame.size.width/2, 100)
drawLine.append(SKShapeNode())
drawLine[index] = SKShapeNode()
line.append(drawLine[index])
line[index].path = path
line[index].strokeColor = UIColor.redColor()
line[index].fillColor = UIColor.redColor()
line[index].lineWidth = 5.0
line[index].physicsBody = SKPhysicsBody(edgeFromPoint: CGPointMake(512, 100),toPoint: CGPointMake(locationX ,locationY))
line[index].physicsBody.dynamic = false
line[index].zPosition = 1
self.addChild(line[index])
index++
}