Reputation: 10021
In sprite kit, how do I rotate a sprite from a position other than its center? does changing its anchor point have anything to do with this?
I'm using an action to perform the rotation:
let action = SKAction.rotateToAngle(1, duration: 0.1, shortestUnitArc: true)
node.runAction(action)
Upvotes: 0
Views: 66
Reputation: 22939
Yes, you need to change the anchorPoint
. The x and y of the anchorPoint
can vary from 0
to 1
, this image from Working With Sprites should help explain:
Upvotes: 1