I have a SKLabelNode which has a string that I'd like to replace with an icon.
let attachment = NSAttributedString(attachment: txt)
attributedString.replaceCharacters(in: NSRange(location: range.location, length: range.length), with:…
I'm trying to warp an SKLabelNode as a child of SKEffectNode (documentation says you can do that), but it flips the label node upside-down before it applies the warp. This may be a bug, but before I file it, I thought I'd ask on here...
Here's my…
I basically want to add custom font numbers (with images) in Singles and add them for my score in my game with SpriteKit.
This is the font image style
They are numbers from 0 to 9
I have been trying to figure this out for a while.
I'm not sure…
So I have an SKLabelNode which displays the users high score, when the users highs score is for example 5 the labels position isn't in the same position to where it would be if the score was for example 35, or 100 makes the label go off screen,…
I have a number of SKSpriteNodes with SKLabelNodes as children. What I would like is for any touch within the bounds of the sprite node to be handled by the sprite node, and for its children (the label nodes) to completely ignore touches. I tried…
I am working on a game and i need to implement the top bar, holding the details like score and other stuff.
My top bar should have the following (left to right):
- a 50x50 icon that changes according to level, but it's the same size
- a label with…
I am having a problem with a slight delay (lag) when transitioning from one SKScene to another. By commenting out various bit of code I have narrowed this down to SKLabelNode, my guess is thats its loading / caching the font when called which is…
I am attempting to create text that has an outline. I am currently using SKLabelNode with NSAttributedString, which you can now do in SpriteKit as of iOS 11. The problem is, if the stroke width is too thick, then the outline gets cut off by what…
I have been trying to add a background around my SKLabelNode, but I can't figure out how to do it programmatically in swift 3. I see some old posts that use .background, but that doesn't work for me.
let background = SKSpriteNode(color:…
Im trying to add a kind of background to a label node in my swift game.
imagine my background moving with white clouds, but i want to show the score in the top middle of the scene, everytime a cloud passes the score doesn't show (as i want the text…
I am using SpriteKit to write a game for iOS in Swift. I am still fairly new to SpriteKit.
I would like to support both orientations for both iPhone and iPad, and have found this:
multiple orientations in SpriteKit
This works as expected in the…
I just want to know if is it possible to make a label or anything else who will be a integer and to display it to my gameview.
var pvElf = SKLabelNode(fontNamed:"Chalkduster")
pvElf.text = "100";
pvElf.fontSize = 45;
pvElf.position = CGPoint(x:370,…
How would you get the intrinsicContentSize like for a UILabel but for an SKLabelNode?
My not-so-educated-guess would be to create a UILabel with the same font and just get its' intrinsicContentSize... but this seems sloppy.
Creating an RPG with SpriteKit has me creating SKLabelNode's for displaying all game text. I'm suffering performance issues (FPS dropping & the game lagging) every time my multi-line text box begins auto typing inputted text which uses…