我试图为一个物体创建一个路径,它的形状是数字8,它可以创建一个像8的曲线的路径吗?
如果不是,你建议我怎么做?
谢谢(:
发布于 2016-01-30 18:48:28
下面是一个简单的例子:
var curve = UIBezierPath()
let startPoint = CGPoint(x: 100, y: 50)
curve.moveToPoint(startPoint)
// top right
curve.addCurveToPoint(CGPoint(x: 100, y: 250),
controlPoint1: CGPoint(x: 200, y: 50),
controlPoint2: CGPoint(x: 200, y: 250))
// bottom left
curve.addCurveToPoint(CGPoint(x: 100, y: 450),
controlPoint1: CGPoint(x: 0, y: 250),
controlPoint2: CGPoint(x: 0, y: 450))
// bottom right
curve.addCurveToPoint(CGPoint(x: 100, y: 250),
controlPoint1: CGPoint(x: 200, y: 450),
controlPoint2: CGPoint(x: 200, y: 250))
// top left
curve.addCurveToPoint(CGPoint(x: 100, y: 50),
controlPoint1: CGPoint(x: 0, y: 250),
controlPoint2: CGPoint(x: 0, y: 50))
curve.closePath()
发布于 2016-01-30 17:48:30
SKPhysicsBody路径生成器是一个强大的工具,你可以用他创建你想要的!
非常舒适和容易创造你的道路!
基本指令
链接
https://stackoverflow.com/questions/35104565
复制相似问题