I am working on my first SpriteKit application in Xcode 6, coding in Swift. Now I have made some nice buttons from transparent png files. But I'm trying to show a visual effect when a button is pressed.
An example, as I now show a static button:
let playButton = Button(imageNamed:"playButton") playButton.position = CGPointMake(self.size.width/2, self.size.height/2 - playButton.size.height * 2.5 - displacement) self.sharedInstance.addChildFadeIn(playButton, target: self)
Any effect will be sufficient, possibly a pulsed effect or a glow when pressed. I searched, but I can not find anything in Swift.
edit: more details
class Button: SKSpriteNode { init(imageNamed: String) { let texture = SKTexture(imageNamed: imageNamed)
The AddChildFadeIn function AddChildFadeIn defined in the class: singleton
Any help is much appreciated!
source share