Skip to content

Instantly share code, notes, and snippets.

@ryantbrown
Created February 15, 2015 04:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ryantbrown/fbebfefc04f54a381b44 to your computer and use it in GitHub Desktop.
Save ryantbrown/fbebfefc04f54a381b44 to your computer and use it in GitHub Desktop.
Create a label in swift
// new label node
let lbl = SKLabelNode()
// set label props
lbl.text = "POLYGON";
lbl.fontSize = 20;
// set label position
lbl.position = CGPoint(x:CGRectGetMidX(self.frame), y:CGRectGetMaxY(self.frame)-30);
// add to frame
self.addChild(lbl);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment