Questions tagged [sklabelnode]

Node that draws strings on iOS systems.

Node that draws strings on iOS systems.

https://developer.apple.com/library/IOs/documentation/SpriteKit/Reference/SKLabelNode_Ref/index.html

196 questions
3
votes
1 answer

Odd Positioning of SKLabelNode

I am trying to add a SKLabelNode to the top left of my scene. Currently I am achieving this using a value of "300" func addMoneyLabel() { let moneyLabel = SKLabelNode(fontNamed:"Copperplate") moneyLabel.fontSize = 25 …
SSH This
  • 1,864
  • 4
  • 23
  • 41
3
votes
1 answer

SpriteKit: Is there a way to centre a SKLabelNode according to its baseline

A label has four different verticalAlignmentMode: .Baseline, .Bottom, .Center and .Top. I would like the label to be centred on its position according to its baseline. .Center doesn't work for me because the bottom of the frame isn't the baseline of…
Shuri2060
  • 729
  • 6
  • 21
3
votes
2 answers

IOS Swift SpriteKit SKLabel, animate appearance of text

I want to to animate appearance of Label's text so that it looks like it is being typed in at the moment. I was wondering if there is a relatively easy way to do so in SWIFT. Thank you.
Michael Voline
  • 383
  • 3
  • 13
3
votes
1 answer

Making SKLabelNode as a crop node of SKShapeNode

Can't find in web, how to make SKLabelNode cropping SKShapeNode. When i colorize the background, my goal is colorize the label too with the same method, so both of them have to colorize simultaneously. But can't imagine how to crop SKShapeNode with…
3
votes
4 answers

Applying different colors to certain parts of SKLabelNode's text

I am pretty much sure that for this can't be used NSMutableAttributedString and NSAttributedString. What I've tried is: NSMutableAttributedString * newString = [[NSMutableAttributedString alloc] initWithString:@"firstsecondthird"]; [newString…
Whirlwind
  • 14,286
  • 11
  • 68
  • 157
3
votes
2 answers

Can I create SpriteKit texture atlas in runtime

I'm developing an os x / iOS crossword game which uses SKLabelNode to display the crossword letters as a child on a SKNode subclass. So for each letter there is SKNode.SKLabelNode. Without using SKLabelNode the draw counts are in the range of 6-8.…
Simon Kemper
  • 635
  • 1
  • 7
  • 16
3
votes
1 answer

SKAction.colorizeWithColor makes SKLabelNode disappear

I'm using SKLabelNode. I'm creating it and add it to my scene as a child and it displays with no problem, but when I try to change it's color (not fontColor) with the colorizeWithColor() method the label fades out. Here is the line with the…
GuessGen
  • 165
  • 8
3
votes
2 answers

Align multiple SKLabelNodes by Baseline

I have a collection of SKLabelNodes. Each node represents a letter of a word. Each node is the child of an SKSpriteNode. The spriteNodehas an explicit hight set on it (the hight returned by [text sizeWithAttributes:@{NSFontAttributeName : font}];),…
baxterma
  • 811
  • 1
  • 11
  • 22
3
votes
2 answers

Scaling a SKSpriteNode without its children being scaled

I'm trying to create buttons programmatically. I have subclassed SKSpriteNode and one of its children is an SKLabelNode. The reason I did this is so that the label and button move together and are one unit. The problem is that when I scale the…
02fentym
  • 1,762
  • 2
  • 16
  • 29
3
votes
1 answer

SKLabelNode without transparent background

Hi I'm using a custom font on a SKLabelNode. I'm able to set the font colour but ok, but the inner parts of the text, are transparent. Is there a way i can set this colour to white for example? my code so far scoreLabel.fontColor = [SKColor…
user1216855
  • 275
  • 1
  • 4
  • 12
2
votes
0 answers

SpriteKit - Scene Scale Mode with No Filter?

I am making a game in SpriteKit for macOS using Swift, and due to my pixel art style, my SpriteKit scene has a size of 384 x 216, and I have relied on my scale mode to fix everything in fullscreen. I realize that my pixel art becomes blurry with…
user7254518
2
votes
1 answer

SpriteKit SKLabelNode alignment

I am trying to get center some text at the center of the scene with a specific size. func addCubeExperienceLabel(_ buttonSize : CGSize, _ buttonPos : CGPoint, _ world : Int) { let price = SKLabelNode(fontNamed: "LCDSolid") price.text =…
Pablo
  • 1,302
  • 1
  • 16
  • 35
2
votes
2 answers

Change the text of a SKLabelNode added from the scene editor

I want to change the text of a SKLabelNode created in the scene editor named myScoreLabel to update a score on collision of two objects. Here's the relevant code: class holeOne: SKScene, SKPhysicsContactDelegate { var myScoreLabel:…
Tom Wicks
  • 785
  • 2
  • 11
  • 28
2
votes
1 answer

Make touch-area for SKLabelNode bigger for small characters

I'm adding an old-school high-score entry screen to my game, in which the users tap each letter to enter their name. Each letter, symbol or phrase ('DEL', 'SP' etc) is a single SKLabelNode and it's very difficult to tap on the ',' and '.'…
Steve Ives
  • 7,894
  • 3
  • 24
  • 55
2
votes
1 answer

Updating SKLabel text through an SKNode subclass

My Goal: add one to the amount variable of the Achievements Class and then update the text so it shows on the SKLabelNode called "AmountLabel" So I have a subclass of SKNode that shelters my SKSpriteNode that shows the emblem of the achievement and…
Astrum
  • 375
  • 6
  • 21
1 2
3
13 14