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")
…
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 ()…
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…
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…
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) {
…
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…
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…
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()
…
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…
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,…
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…
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…
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…
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 =…