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
1
vote
1 answer

Is it possible to update an SKLabelNode?

I'm trying to update the coinLabel, so that when the "life" node is tapped, it will update the SKLabelNode and display the correct coins after they have been subtracted from the total. I'm new to coding, so if there is anything else wrong with this…
1
vote
3 answers

updating an SKLabel to show the right integer

ok so first off I have an achievement Variable that is defined from a struct like so: struct Achieve { var node: SKSpriteNode? var aName:String = "" var aDes:String = "" var aImage: String = "" { didSet { node?.texture =…
Astrum
  • 375
  • 6
  • 21
1
vote
4 answers

SKLabelNode not showing up

I am trying to get an SKLabelNode to show up on my screen, but it doesn't show. Here is my code... override func didMoveToView(view: SKView) { let textLabel = SKLabelNode(fontNamed: "Avenir-Black") textLabel.text? = "HI THERE" …
1
vote
1 answer

How to have CGPath from SKLabelNode?

How can I extract the polygon path from a SKLabelNode? For example I want the edge path of a number like this to move along a SKSpriteNode: Do you think is possible? Or I must create a polygon for each character like: var pathNumberOne =…
Simone Pistecchia
  • 2,746
  • 3
  • 18
  • 30
1
vote
1 answer

Removing an SKLabel after a period of time

So I was just messin around in xcode and I ran into a problem. I created a system where every time the user touches any where on the screen it creates a SKLabel with a random color where the user touches. How could I have the SKLabels that are…
Charles
  • 31
  • 3
1
vote
1 answer

SKLabel.text Integer not updating - swift

Im creating a game and i have created and integer which keeps track of the number of enemies killed, however i can not get the sklabel on the UI to update. no matter how many enemies the integer kept displaying 0. Here are some of the methods i…
gkolman
  • 189
  • 10
1
vote
2 answers

Integer value not updating

I am creating a game and I am trying to keep a record of all enemy's killed but my SKLabel node is not updating. Here's how I'm implementing it class GameScene: SKScene, SKPhysicsContactDelegate { var Enemy1KillCounter:Int = 0 var…
gkolman
  • 189
  • 10
1
vote
2 answers

Score label node disappears after first round

I don't know why, but score label node dissapears after first round.I have two scores, one for human ,other for computer : -(void)scoreCount{ if(scoreLabel == nil){ NSString* scoretxt =[NSString stringWithFormat:@"0"]; [scoreLabel…
artG
  • 235
  • 3
  • 12
1
vote
2 answers

How to disable anti-aliasing in SKLabelNode?

I want to use a pixel font in my SpriteKit game. But I can't use a bitmap font because I need to support many languages (too many characters). So I should use a ttf font file. I tried the following code, but characters were blurred by…
Mac
  • 137
  • 1
  • 8
1
vote
1 answer

SKLabelNode display text at specified time

I'm making a scene in which the lyrics to a song which is played in the background of a scene are displayed line by line at the bottom of a spriteKit scene. I've tried a number of different solutions, but for some reason with each of them some of…
derekFairholm
  • 285
  • 1
  • 14
1
vote
1 answer

Changing default SKScene

I have a class called IntroLayer I'm trying to load as the inital scene when my game is launched. However after simply changing the GameScene to IntroScene as described in these simple steps, my IntroScene isn't being loaded. I set breakpoints on if…
Jenna25
  • 99
  • 1
  • 8
1
vote
3 answers

How would I save a label using NSUserDefaults in swift?

I have these two UITextFields and the first texField subtracts the number from the second textField. It then takes the answer and puts it in my SKLabelNode. That works fine. But the problem Im having is that it doesn't save the label. When I quit…
coding22
  • 689
  • 1
  • 7
  • 28
1
vote
2 answers

SpriteKit layout issues (Swift)

I'm new to SpriteKit and Swift (done a lot in Obj-C in the past for iOS) but I'm struggling on something that should be very basic.. positioning sprites on the screen! Centering a label on the screens seems easy enough: myLabel.position =…
FlatDog
  • 2,685
  • 2
  • 16
  • 19
1
vote
1 answer

SKLabelNode custom size between devices

I'm using an SKLabelNode to display a score on a universal game. The font size is perfect for iPhone but naturally needs to be bigger for iPad. I was wondering if there is any way to change the font size just for iPad? I tried this in didMoveToView:…
JGrn84
  • 750
  • 1
  • 9
  • 26
1
vote
0 answers

SKLabelNode font name spelled wrong, making the program hang

While I was running my program I noticed at the part of the code where I declared a SKLabelNode and filled out its attributes, the program was hanging there (I knew this due to NSLog statements). What I saw was that I spelled 'Arial' wrong, instead…
Andrew
  • 391
  • 3
  • 15