Created
March 20, 2017 23:51
-
-
Save jjacobson93/69600867868a78a8990b775fbfd56042 to your computer and use it in GitHub Desktop.
Custom SKAction
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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