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

SpriteKit: Font not showing up in editor

This question is regarding "No Font" problem in SKLabelNode that appears in SpriteKit scene editor in Xcode: I pulled the recent changes in the project where a new font was added. Checked everything: Font included into the Copy Bundle Resources -…
kelin
  • 11,323
  • 6
  • 67
  • 104
0
votes
1 answer

Neither adding a SKShapeNode nor adding a SKLabelNode to a SKScene appears to work?

Neither adding a SKShapeNode nor adding a SKLabelNode to a SKScene appears to work? My gut guesses that I have a coordinate problem .. so here's the short code snippet which I have placed in my GameViewController class: Note: I've added print…
user20439709
0
votes
1 answer

SKLabelNode, can't use "SFMono-Light" as font

im try to use the font "SFMono-Light" as font of my SKlabel.. but keep getting the error says "SKLabelNode: SFMono-Light" font not found. func loadSKscene()->SKScene{ // load screenPFD let loadedScene = SKScene(fileNamed:…
Damiano Miazzi
  • 1,514
  • 1
  • 16
  • 38
0
votes
1 answer

SKLabel is not showing when it's assigned to a specific element

(All the following code has been written in Swift Playgrounds) First I added 3 variables and put those in an array var rnaBacteriaCopy1 = SKSpriteNode() var rnaBacteriaCopy2 = SKSpriteNode() var rnaVirusCopy4 = SKSpriteNode() let rnaCopies =…
0
votes
1 answer

enumareteChildNodes with collision detection swift

I am trying to code a word collision detection game. The problem is that before I add rectangle as a background of my words, all of my codes are working, I can detect the collision and take action. but after add rectangle, I have to change my…
0
votes
0 answers

Add dynamically SKLabelNode to MKTVIew

I am working on metal view that shows the heart rate graph. between every peak of this graph, I need to add a label. In this process, chart moving from right to left I have an array that dynamically shows the x coordinate of this label for example…
Peter hes
  • 101
  • 6
0
votes
0 answers

Add a popup text view to a SpriteKit game

I am creating a SpriteKit game and want to be able to take advantage of textAlerts - like all the games I grew up playing. I also want them to be flexible so I can subclass them and add them throughout my game - I am not sure how to do this and so…
sam_smith
  • 6,023
  • 3
  • 43
  • 60
0
votes
0 answers

How to programmatically change text of SKLabelNode?

I added some SKLAbelNode into SKNode, which is placed inside SKScene I need SKNode for grouping some nodes I added name "altitude" to my SKLAbelNode and put this code into SKScene class which was associated with my .sks file var altitude:SKLabelNode…
Ilya
  • 61
  • 1
  • 10
0
votes
0 answers

How to position an SKLabelNode on top of a UISlider in SpriteKit

I'm using UISliders in my SpriteKit game. Sometimes I want to pause the game and add some info in an SKLabelNode but I can't find a way to position the SKLabelNode on top of a UISlider. Here's a simplified example. override func didMove(to view:…
Ross Knipe
  • 518
  • 3
  • 16
0
votes
2 answers

How to trigger a notification if label is dropped on wrong target?

In this drag and drop game (adapted from this tutorial), the player has to match the label to the right target. I have it set so that if the touch ends and the label's center is inside the target, it is removed from the screen and the game starts…
edh
  • 7
  • 6
0
votes
1 answer

SKLabelNode showing on iPhone simulation but not iPad

I have this code to put a score label for my game in the top left corner of the screen. scoreLabel = SKLabelNode(text:"bats avoided: \(score)") scoreLabel.fontSize = 50 scoreLabel.horizontalAlignmentMode = .left scoreLabel.position…
JustABeginner
  • 321
  • 1
  • 5
  • 14
0
votes
1 answer

Why colorBlendFactor does not affect 'SKLabelNode' on my device in Swift?

I'm trying to change color on SKLabelNode in my project. When I run the project on iPhone 5s with iOS 11.1.2 the SKLabelNode have the correct color, but when I run the project on iPad with iOS 9.3.5 the SKLabelNode appears in white. Here is how I…
EranKT
  • 325
  • 1
  • 4
  • 15
0
votes
4 answers

How do you store integer values in a SKLabelNode

I am trying to store in integer value in a SKLabelNode but I keep geting an error that I can only store strings. I need it as an integer later. Here is my code: import SpriteKit import GameplayKit class GameScene: SKScene { override func…
Isaac Dragon
  • 61
  • 1
  • 4
0
votes
1 answer

Spiked text in SKLabelNode

Spiked text in SKLabelNode, font exist in project. When add text in SKLabel node I see many artefacts on font like this : enter image description here this screen shot from iPhone 6s. I think this is SpriteKit work, but hove fix this?
0
votes
0 answers

Text is stretched - sprite kit

I have a SKLabelNode called round. Here is the code for that below: round = SKLabelNode(fontNamed: "arial") round.text = "Round: 1" round.color = UIColor.white round.fontSize = 20 round.position.x = 150 round.position.y = 100 round.zPosition =…
Rishi
  • 399
  • 6
  • 23