Is there a possibility to change the number of lines of an SKLabelNode?
Like UiLabel:
UILabel *label = [UILabel new];
label.numberOfLines = 2;
Is there a possibility to change the number of lines of an SKLabelNode?
Like UiLabel:
UILabel *label = [UILabel new];
label.numberOfLines = 2;
It's possible. Just set numberOfLines
+ preferredMaxLayoutWidth
:
let lb = SKLabelNode(fontNamed: "Courier-bold")
lb.numberOfLines = 0
lb.preferredMaxLayoutWidth = size.width
Currently that is not possible.
You could create your own SKMultilineLabelNode
class if you wanted to, and as mentioned in the comments there is an extension on github.