这里我试图为我已成功创建SKShapeNode边框的网格绘制gridLines但是在运行此代码时我无法看到这些线条。
func drawGridLines() {
print("drawing")
for row in 0...40 {
let path = CGPathCreateMutable()
CGPathMoveToPoint(path, nil, grid.frame.origin
.x , grid.frame.origin.y + CGFloat(row * 10))
CGPathAddLineToPoint(path, nil, grid.frame.width, grid.frame.origin.y + CGFloat(row * 10))
let shape = SKShapeNode(path: path)
shape.path = path
shape.position = CGPoint(x: CGRectGetMidX(frame), y: CGRectGetMidY(frame))
shape.fillColor = UIColor.redColor()
shape.strokeColor = UIColor.blueColor()
shape.lineWidth = 10
addChild(shape)
for col in 0...90 {
print("y")
}
}
}