I created the SgButton class ( https://github.com/nguyenpham/sgbutton ) in Swift to create buttons for SpriteKit. You can create buttons with images, textures (from SpriteSheet), text and background images / textures. For example, to create a button with an image:
SgButton(normalImageNamed: "back.png")
Create a button with textures:
SgButton(normalTexture: buttonSheet.buy(), highlightedTexture: buttonSheet.buy_d(), buttonFunc: tappedButton)
Create a round text button:
SgButton(normalString: "Tap me", normalStringColor: UIColor.blueColor(), size: CGSizeMake(200, 40), cornerRadius: 10.0, buttonFunc: tappedButton)
Tony
source share