Latest 4.0.1
Homepage https://github.com/maximbilan/SKTextureGradient
License MIT
Platforms ios 8.0, requires ARC
Authors

Version
License
Platform
CocoaPods
CocoaPods

A simple SKTexture extension for creating a gradient effect in SpriteKit.

Installation

CocoaPods:

pod 'SKTextureGradient'

Manual:

Copy SKTextureGradient.swift to your project.

Using

let topColor = CIColor(rgba: "#71B280")
let bottomColor = CIColor(rgba: "#134E5E")

let texture = SKTexture(size: CGSizeMake(200, 200), color1: topColor, color2: bottomColor, direction: GradientDirection.up)
texture.filteringMode = .Nearest

let sprite = SKSpriteNode(texture: texture)
sprite.position = CGPointMake(CGRectGetMidX(frame), CGRectGetMidY(frame))
sprite.size = self.frame.size
addChild(sprite)

Example

alt tag

License

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

Latest podspec

{
    "name": "SKTextureGradient",
    "version": "4.0.1",
    "summary": "SKTexture extension",
    "description": "Sprite Kit SKTexture Gradient",
    "homepage": "https://github.com/maximbilan/SKTextureGradient",
    "license": {
        "type": "MIT"
    },
    "authors": {
        "Maxim Bilan": "[email protected]"
    },
    "platforms": {
        "ios": "8.0"
    },
    "source": {
        "git": "https://github.com/maximbilan/SKTextureGradient.git",
        "tag": "4.0.1"
    },
    "source_files": [
        "Source",
        "*.{swift}"
    ],
    "requires_arc": true
}

Pin It on Pinterest

Share This