I want to rotate an SKShapeNode around its axis (a task I assumed would be easy to do in a framework like SpriteKit). The shape rotates, but around an axis that seems to be off screen...
Any ideas on what's going wrong here?
import SpriteKit
class Square: NSObject {
// this gets created and initialized later...
var shape: SKShapeNode? = nil
//…
func animateMe(){
let action = SKAction.rotateByAngle(CGFloat(M_PI), duration:1)
self.shape.runAction(action, completion: { [unowned self] () -> Void in
self.shape.removeFromParent()
})
}
}