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
0
votes
1 answer

SKLabelNode fontSize

Could somebody please let me know what to do to make an SKLabelNode font size adjust to all screen sizes. I dont mean answers such as checking the device first e.g. if UIDevice.... If you create a new Xcode project with the SpriteKit game template…
crashoverride777
  • 10,581
  • 2
  • 32
  • 56
0
votes
1 answer

SKLabelNodes drop fps

I have a little game based on SpriteKit. In this game I use lots of Nodes with letters (or combinations of letters) on it that user can move around to build words. Those nodes are basically SKSpriteNodes with SKLabelNodes on them. When I have a…
0
votes
2 answers

I can't understand why the location in touchesBegan isn't working properly with SKLabelNode

So I got a NSLog, which gets location of touch in view -(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event{ for (UITouch *touch in touches) { CGPoint location=CGPointMake([touch…
Fominykh Maxim
  • 485
  • 1
  • 6
  • 20
0
votes
1 answer

Setting SKLabelNode font colour appears to be broken in iOS 9

Since the iOS 9 update, setting an SKLabelNode's font colour appears to be broken. Calling this sets text to green! SKLabelNode *labelNode = [SKLabelNode labelNodeWithFontNamed:GameFont]; [labelNode setFontColor:[UIColor blackColor]]; And setting…
Smikey
  • 8,106
  • 3
  • 46
  • 74
0
votes
0 answers

how does the swift sprite kit SKScene coordinate system work?

when i add a label to the scene at x=100 y=100, it doesn't show up on the iPhone 6 simulator but when i add it at x=500 it shows up. why doesn't x start from 0?
Jamal H
  • 934
  • 7
  • 23
0
votes
0 answers

White block instead of text using SKLabelNode

Today I notice a very strange thing, instead of the label that I want to display 0 I get a white block, even though fontColor is set to black // In MPSingleton let gameFontRegular = UIFont(name: "HelveticaNeue", size: 1.5) func addText(withText:…
grape1
  • 759
  • 2
  • 8
  • 19
0
votes
1 answer

SKLabelNode change text with SKAction

Is there a way I can get an SKLabelNode to change its text property using an SKAction? I would prefer an answer in Swift but one in Objective C will suffice. Thanks
Lahav
  • 781
  • 10
  • 22
0
votes
1 answer

how to add a SKLabel in the SKScene editor

I'm using the SKScene editor of XCode to create scenes for a game using SpriteKit. I can successfully add sprites, lights, nodes, labels... and use it in the code but I don't find how to add a SKLabel using the SKScene editor of Xcode. Is it…
Jonah Begood
  • 317
  • 2
  • 14
0
votes
1 answer

How to display score in different scene

I'm making a game and I have a function that calculates the score and displays it on the screen. When the game ends it transitions into a new scene, (game over screen). I was wondering what method I can use to display my score on the second scene…
NickyNick321
  • 213
  • 1
  • 4
  • 12
0
votes
2 answers

Sprite Kit Button touch location error | Swift

I'm trying to make a button that's an SKLabelNode. When it gets pressed, it's supposed to change scenes, but there is something wrong with the line where location is declared. override func touchesBegan(touches: Set, withEvent event:…
pizzafoot
  • 125
  • 1
  • 1
  • 8
0
votes
1 answer

SKLabelNode doesn't render anything

I have a strange problem. I am using a SKLabelNode in one of my projects. It does not show me any errors, but nothing appears either. What am I doing wrong? @implementation GameScene { SKLabelNode *myTitle; } - (void)didMoveToView:(SKScene *)view…
0
votes
2 answers

Counting number of letters in a SKLabelNode

I want to count the amount of letters in the text of a sklablenode, is this possible? So if: mySklabelnode = SKLabelNode() mySklabelnode.text = "testing" Than I want the result to be: 7 How can this be done?
sdd
  • 889
  • 8
  • 29
0
votes
0 answers

SKLabelNode Centring After Setting Alignment Mode to Left

I have a SKLabelNode that I want positioned centre, however I have had to align the label node left and bottom to remove the well documented "jitter effect". I currently set up the scene by positioning nodes by allocating their position using the…
Tom
  • 790
  • 2
  • 9
  • 32
0
votes
1 answer

Position of a Node after addChild

I have an SKSpriteNode like a light gray square in the view, and I want to put a label inside it... I do this way: let puntosCubo = SKSpriteNode(color: SKColor.lightGrayColor(), size: CGSize(width: gameoverTitle.frame.width, height:…
ChristLarsen
  • 115
  • 1
  • 1
  • 9
0
votes
1 answer

Changing label text on SKLabelNode crashes app

I'm trying to change the text in a SKLabelNode at runtime but it crashes the app with an error: CRASH: -[SKLabelNode label]: unrecognized selector sent to instance I'm calling it from a selectNodeForTouch:(CGPoint)touchlocation method as follows: …
Linda Keating
  • 2,215
  • 7
  • 31
  • 63