https://github.com/maximbilan/sktexturegradient
A SpriteKit SKTexture Gradient
https://github.com/maximbilan/sktexturegradient
gradient ios spritekit swift texture
Last synced: 2 months ago
JSON representation
A SpriteKit SKTexture Gradient
- Host: GitHub
- URL: https://github.com/maximbilan/sktexturegradient
- Owner: maximbilan
- License: mit
- Created: 2016-01-01T15:30:02.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2018-09-21T14:08:24.000Z (over 6 years ago)
- Last Synced: 2025-04-14T06:55:08.603Z (2 months ago)
- Topics: gradient, ios, spritekit, swift, texture
- Language: Swift
- Homepage:
- Size: 16.6 KB
- Stars: 30
- Watchers: 1
- Forks: 5
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# SKTextureGradient
[](http://cocoadocs.org/docsets/SKTextureGradient)
[](http://cocoadocs.org/docsets/SKTextureGradient)
[](http://cocoadocs.org/docsets/SKTextureGradient)
[](https://cocoapods.org/pods/SKTextureGradient)
[](https://cocoapods.org/pods/SKTextureGradient)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 = .Nearestlet sprite = SKSpriteNode(texture: texture)
sprite.position = CGPointMake(CGRectGetMidX(frame), CGRectGetMidY(frame))
sprite.size = self.frame.size
addChild(sprite)# Example

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