I have been using the following code in my game. The Problem is that i am unable to make multi-line label in spritekit as i was able to do using CCLabelTTF...... Can Somebody help me. Also i am unable to use either \t or \n in my code... Thanks for the reply in advance
SKLabelNode *winner = [SKLabelNode labelNodeWithFontNamed:@"Arial"];
winner.text = @"Another\nTest";
winner.fontSize = 32;
winner.fontColor = [SKColor blueColor];
winner.position = CGPointMake(100 , 160);
[self addChild:winner];
I had the same problem. I created a drop-in replacement for SKLabelNode called DSMultilineLabelNode that supports word wrap, line breaks, etc. The underlying implementation draws the string into a graphics context and then applies that to a texture on an SKSpriteNode.
It's available on GitHub at:
https://github.com/downrightsimple/DSMultilineLabelNode
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With