Latest 1.0.0
Homepage https://github.com/hanjoes/SKSpriteButton
License MIT
Platforms ios 8.0
Authors

CI Status
Version
License
Platform

Info

SKSpriteButton is something obvious but somehow missing from the official SpriteKit library.

Usage

This library should be very straightforward to use.

Color

Set tappedColor property for a different display color when tapped.

Since this widget inherits from SKSpriteNode, which will only show texture if both texture and color are set. tappedColor will not be shown if the button has a texture.

Texture

Set tappedTexture property for displaying a different texture when tapped.

Move Types

Set moveType property for different move types supported move types are:

public enum MoveType {
    case alwaysHeld
    case releaseOut
    case releaseFast
    case reentry
}

The names should be self-explainatory. But still I put a screencast for different move type behaviors.

Demo

More

There is no more, check SKSpriteButton.swift for public APIs.

Example

I’ve built a simple example project to elaborate on how to use this widget. The example project shows how "move types" differ from each other.

To run the example project, clone the repo, and run pod install from the Example directory first.

Note: I’ve actually included all files needed to compile the project in the git repo. You should be able to run the example even without pod install.

Requirements

Installation

SKSpriteButton is available through CocoaPods. To install
it, simply add the following line to your Podfile:

pod 'SKSpriteButton'

Author

hanjoes, [email protected]

License

SKSpriteButton is available under the MIT license. See the LICENSE file for more info.

Latest podspec

{
    "name": "SKSpriteButton",
    "version": "1.0.0",
    "summary": "Button implemented using SpriteKit.",
    "description": "This framework implements the Button widget which should be heavily used butnmissing from SpriteKit.",
    "homepage": "https://github.com/hanjoes/SKSpriteButton",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "hanjoes": "[email protected]"
    },
    "source": {
        "git": "https://github.com/hanjoes/SKSpriteButton.git",
        "tag": "1.0.0"
    },
    "platforms": {
        "ios": "8.0"
    },
    "source_files": "SKSpriteButton/Classes/**/*",
    "pushed_with_swift_version": "4.0"
}

Pin It on Pinterest

Share This