I'm trying to keep the left side of an SKLabelNode fixed after updating it. The thing is that the SKLabelNode is growing in both directions. All I want is to grow only in the right side. Thanks a lot.
Asked
Active
Viewed 5,525 times
1 Answers
29
The problem is, that SKNodes have their origin in the center of their node. So you will have to set the SKLabelHorizontalAlignmentMode to "left" to resolve this problem.
var label:SKLabelNode = SKLabelNode()
label.horizontalAlignmentMode = SKLabelHorizontalAlignmentMode.Left
Here a picture, what the different modes do: