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
0 answers

How to fill out an SKLabelNode with a specific color through animation?

I've been searching the internet for a while now and I couldn't come up with any solution. I've created a SKLabelNode in my SpriteKit project which displays level numbers. SKLabelNode: let levelLbl = SKLabelNode(fontNamed: "LEMON-Bold") …
1
vote
0 answers

Why does my closure property on a SKLabelNode subclass become nil?

I have the following SKLabelNode subclass: class ButtonNode: SKLabelNode { // The only reason this is optional is because of the required init() method. private var buttonAction: (() -> Void)? init(_ text: String, action: @escaping ()…
DanielGibbs
  • 9,910
  • 11
  • 76
  • 121
1
vote
1 answer

How to recall SKLabelNode

I am making a game with SpriteKit. I am trying to add a SKLabelNode (pointsLabel), and I have got it to work if I don't set label.isHidden = true. However, I want the Label to be hidden until touchesBegan, but it seems like I can't recall the…
1
vote
2 answers

How to display 2 labels in one scene?

I am totally new with Swift and SpriteKit, apologies I really know nothing. I am trying to add 2 consecutive SKLabelNode in a single scene. The background of the scene is .black. I created a function that generates a SKShapeNode from a UIBezierPath…
Scudice
  • 21
  • 3
1
vote
0 answers

SKLabelNode truncates leading spaces when displaying

Problem: The text string to be displayed by an SKLabelNode does not show the leading spaces when shown in the SKScene. Example (Swift): class ExampleScene: SKScene { var titleLabel = SKLabelNode() override func didMove(to view: SKView) { …
user8303233
1
vote
1 answer

£ (Pound) Currency is not rendered by SKLabelNode in SpriteKit iOS 11.3.x

There is an In-app-Purchase screen where I have to display a button with text "unlock all £0.99" so that when player clicks that the In-app purchase moves forward. The currency and localised price value are retrieved & populated from…
1
vote
1 answer

Setting a custom class for a SKLabelNode in SpriteKit scene editor?

I have a class PrettyLabel which is a subclass of SKLabelNode class. How can I set this as a custom class for a node which is a SKLabelNode in spritekit scene editor in .sks file? Is it possible? For SKSpriteNode there is an option named custom…
Leszek Szary
  • 9,763
  • 4
  • 55
  • 62
1
vote
1 answer

Swift 4 SKLabelNode not appearing

I have been trying for a while to display a simple SKLabelNode, with no luck. I have tried many different ways, with mixed results. This is what I have currently, but nothing shows up: func layoutMenu() { let appNameLabel = SKLabelNode() …
user7639007
  • 143
  • 1
  • 1
  • 7
1
vote
1 answer

SKLabelNode - get actual number of lines

In SpriteKit, you can now set the number of lines of an SKLabelNode, so the label may go through a few lines. let lb = SKLabelNode(fontNamed: "Courier-bold") lb.numberOfLines = 0 lb.preferredMaxLayoutWidth = size.width Is there any way to…
Mike Keskinov
  • 11,614
  • 6
  • 59
  • 87
1
vote
1 answer

SpriteKit: modify SKScene frame programmatically

I want to modify the size of SKScene but I have figure out how to do it. I have figure out how change the size but it square taking the smallest size of the screen: func makeScene() -> SKScene { let minimumDimension = min(view.frame.width,…
user2924482
  • 8,380
  • 23
  • 89
  • 173
1
vote
1 answer

How can I put a coin label in the corner of every device in my universal app?

I am wanting to create a SKLabelNode that is in the top left corner of every device. Also, to the left of the label in the top left corner I want an image that is a coin to show that this is the current coin count label. Every time I place my label…
Josh Schlabach
  • 401
  • 5
  • 17
1
vote
1 answer

SKLabelNode not showing up in SKScene

override func didMove(to view: SKView) { let blankScoreLabel = "SCORE: " scoreLabel.fontSize = 45 scoreLabel.text = blankScoreLabel scoreLabel.position = CGPoint(x: 2, y: 2) scoreLabel.color = UIColor.red …
Tim2799
  • 71
  • 1
  • 1
  • 10
1
vote
1 answer

Determine if UITouch is within SKLabelNode frame

My goal is to find out if a UITouch took place within a SpriteKit label node. The view is an SKView. The issue with the code that I am using (below) is that the touch and the rectangle seem to be in different coordinate systems. I could use simple…
Taylor
  • 547
  • 2
  • 7
  • 16
1
vote
1 answer

SKLabelNode related EXC_BAD_ACCESS crash

Im currently having a crash which I can't find a solution for. In the application I'm developing I have a custom class LabelNode: SKNode which uses a SKLabelNode and a SKSpriteNode to create white text on a black square background. This label is…
Bob
  • 11
  • 3
1
vote
1 answer

SKLabelNode not displaying the right CGPoint

I have a problem in my game and i am trying to find out what it is and it is about the position of a SKSpriteNode and i made a SKLabelNode to display the position so i could see what is going wrong. I did: testlable.text =…
Repardeimaj
  • 401
  • 3
  • 15