如何在Swift 4中的`CGMutablePath`上添加`SKEmitterNode`?

时间:2017-11-18 08:12:32

标签: swift sprite-kit skspritenode cgpath skemitternode

我有一艘飞船在椭圆轨道上飞行。见下面的代码。

我想在赛道上添加SKEmitterNode作为“气体排放”。如何在船舶通过后在路径上添加SKEmitterNode

let shipSprite = SKSpriteNode(texture: SKTexture(image: #imageLiteral(resourceName: "spaceShip")))
let shipPoint = CGPoint(x: self.size.width/4, y: self.size.height/2)

let pathOfShip = CGMutablePath()
pathOfShip.addEllipse(in: CGRect(origin: CGPoint(x: 40,y: -20), size: CGSize(width: -80, height: -130)))

shipSprite.run(SKAction.follow(pathOfShip, asOffset: true, orientToPath: true, duration: 5.0))

0 个答案:

没有答案