我想在其中心点上一个圆形节点。我一直在努力追随:
var earthBase = SKSpriteNode(imageNamed: "earthBase")
earthBase.position = CGPoint(x: 667, y: 20)
earthBase.physicsBody = SKPhysicsBody(texture: earthBase.texture!, size: earthBase.size)
earthBase.physicsBody!.allowsRotation = true
earthBase.physicsBody!.linearDamping = 1
earthBase.physicsBody!.affectedByGravity = false
earthBase.physicsBody!.isDynamic = false
earthBase.name = "earthBase"
earthBase.zPosition = 9
addChild(earthBase)
let spin = SKAction.rotate(byAngle: CGFloat.pi, duration: 60)
let spinForever = SKAction.repeatForever(spin)
earthBase.run(spinForever)
当我这样做时,它像下面的蓝色圆圈图片一样旋转,但我想像绿色圆圈那样旋转它的中心。我已经尝试更改锚点(上面的代码中没有/默认)但这只会将它移动到更远的红点。
有什么想法吗?