Reputation: 191
I have seen that to make a UILabel's text align to different sides you can use
yourLabel.textAlignment
However, I am creating a game in SpriteKit and do not have this option on an SKLabelNode. My question is how can I align the text left on an SKLabelNode?
Upvotes: 1
Views: 150
Reputation: 142
For an SkLabelNode, horizontalAlignmentMode
changes whether the text is centered on the node's origin, the text is on the left side node's origin, or the text is on the right side of node's origin.
So you can do label.horizontalAlignmentMode = .right
to align the text to the left.
There is more information on this here.
Upvotes: 1