Skip to content

Instantly share code, notes, and snippets.

@jjacobson93
Created March 20, 2017 23:51
Show Gist options
  • Save jjacobson93/69600867868a78a8990b775fbfd56042 to your computer and use it in GitHub Desktop.
Save jjacobson93/69600867868a78a8990b775fbfd56042 to your computer and use it in GitHub Desktop.
Custom SKAction
let updateTimeLabel = SKAction.customAction(withDuration: 5) {
(node, elapsedTime) in
if let label = node as? SKLabelNode {
label.text = "\(elapsedTime)s"
}
}
let timeLabel = SKLabelNode(fontNamed: "Chalkduster")
timeLabel.text = "0s"
timeLabel.run(updateTimeLabel)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment