Could somebody please let me know what to do to make an SKLabelNode font size adjust to all screen sizes.
I dont mean answers such as checking the device first e.g. if UIDevice....
If you create a new Xcode project with the SpriteKit game template…
I have a little game based on SpriteKit.
In this game I use lots of Nodes with letters (or combinations of letters) on it that user can move around to build words.
Those nodes are basically SKSpriteNodes with SKLabelNodes on them.
When I have a…
So I got a NSLog, which gets location of touch in view
-(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event{
for (UITouch *touch in touches)
{
CGPoint location=CGPointMake([touch…
Since the iOS 9 update, setting an SKLabelNode's font colour appears to be broken. Calling this sets text to green!
SKLabelNode *labelNode = [SKLabelNode labelNodeWithFontNamed:GameFont];
[labelNode setFontColor:[UIColor blackColor]];
And setting…
when i add a label to the scene at x=100 y=100, it doesn't show up on the iPhone 6 simulator but when i add it at x=500 it shows up. why doesn't x start from 0?
Today I notice a very strange thing, instead of the label that I want to display 0 I get a white block, even though fontColor is set to black
// In MPSingleton
let gameFontRegular = UIFont(name: "HelveticaNeue", size: 1.5)
func addText(withText:…
Is there a way I can get an SKLabelNode to change its text property using an SKAction? I would prefer an answer in Swift but one in Objective C will suffice. Thanks
I'm using the SKScene editor of XCode to create scenes for a game using SpriteKit. I can successfully add sprites, lights, nodes, labels... and use it in the code but I don't find how to add a SKLabel using the SKScene editor of Xcode.
Is it…
I'm making a game and I have a function that calculates the score and displays it on the screen. When the game ends it transitions into a new scene, (game over screen). I was wondering what method I can use to display my score on the second scene…
I'm trying to make a button that's an SKLabelNode. When it gets pressed, it's supposed to change scenes, but there is something wrong with the line where location is declared.
override func touchesBegan(touches: Set, withEvent event:…
I have a strange problem. I am using a SKLabelNode in one of my projects. It does not show me any errors, but nothing appears either. What am I doing wrong?
@implementation GameScene
{
SKLabelNode *myTitle;
}
- (void)didMoveToView:(SKScene *)view…
I want to count the amount of letters in the text of a sklablenode, is this possible?
So if:
mySklabelnode = SKLabelNode()
mySklabelnode.text = "testing"
Than I want the result to be: 7
How can this be done?
I have a SKLabelNode that I want positioned centre, however I have had to align the label node left and bottom to remove the well documented "jitter effect". I currently set up the scene by positioning nodes by allocating their position using the…
I have an SKSpriteNode like a light gray square in the view, and I want to put a label inside it... I do this way:
let puntosCubo = SKSpriteNode(color: SKColor.lightGrayColor(), size: CGSize(width: gameoverTitle.frame.width, height:…
I'm trying to change the text in a SKLabelNode at runtime but it crashes the app with an error: CRASH: -[SKLabelNode label]: unrecognized selector sent to instance
I'm calling it from a selectNodeForTouch:(CGPoint)touchlocation method as follows:
…