• Stars
    star
    115
  • Rank 305,916 (Top 7 %)
  • Language
    Swift
  • License
    MIT License
  • Created over 10 years ago
  • Updated over 3 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Better Easing for SpriteKit in Swift

SpriteKitEasingSwift: Better Easing for SpriteKit in Swift.

CI Status Version License Platform

This easing library began life as a port of buddingmonkey's Objective C SpriteKit Easing library to Swift.

This library extends upon the basic easing equations available in the SpriteKit framework by Apple.

Sprite Kit Easing makes available the following standard easing equations as SKActions.

easing.gif

Use SKEase methods to tween properties of an SKNode, such as:

  • move
  • scale
  • scaleX
  • scaleY
  • rotate
  • fade
  • tweenLabelColor
  • tweenShapeFillColor

If you want to tween a variable, use:

  • createPointTween
  • createFloatTween
  • createColorTween

The SKEase functions return an SKAction that performs the ease. You can then run the SKAction in the same manner you would any other SKAction in SpriteKit.

//eg an SKLabelNode(which extends SKNode) flies in from the right with an elastic tween:
//first create an SKNode, let's create a label node
let titleLabel = SKLabelNode(fontNamed:"Avenir-Light")
titleLabel.text = "Hello world"
titleLabel.fontSize = 65
titleLabel.fontColor = UIColor.white
titleLabel.position = CGPoint(x:self.frame.midX, y:self.frame.midY)
self.addChild(titleLabel)
//perform elastic ease
titleLabel.run(SKEase.move(easeFunction: .curveTypeElastic,
easeType: .easeTypeOut,
time: 2,
from: CGPoint(x: frame.width+titleLabel.frame.width/2, y: titleLabel.position.y),
to:CGPoint(x: -titleLabel.frame.width/2, y: titleLabel.position.y)))

Installation

via CocoaPods

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

pod 'SpriteKitEasingSwift'

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

Don't forget to import the Pod where you would like to use it:

import SpriteKitEasingSwift

via Github:

Clone the project at Github (https://github.com/craiggrummitt/SpriteKitEasingSwift). You will find an example project there as well. To use the framework drag the SpriteKitEasingSwift/Classes folder to your project.

Author

Craig Grummitt

Again, credit and thanks go to SpriteKitEasing and AHEasing and the legend of easing, Robert Penner.

License

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

More Repositories

1

ActionSwift3

ActionScipt3 SDK in Swift
Swift
210
star
2

SwiftXML

Simple XML parsing and serializing in Swift
Swift
23
star
3

Swift-Alerts-popovers-and-modals

Sample Swift code for displaying and customizing UIAlerts, UIViewController.presentViewController, UINavigationController.navigationController.pushViewController and UIPopoverController
Swift
8
star
4

GEDCOMConverter

With GEDCOMConverter, parsing a GEDCOM file to native Swift objects is too easy!
Swift
4
star
5

FlappySwift

Flappy Bird clone in Swift
Swift
2
star
6

pizza-node

JavaScript
2
star
7

RGB-Sliders

RGB-Sliders
Swift
1
star
8

SwiftDebuggingProjectAdvanced

Swift
1
star
9

svul

svul
HTML
1
star
10

JsonStoreReadExample

JSON example in simple storing and reading
Swift
1
star
11

TempNotes

Objective-C
1
star
12

FlashyBird

Flappy Bird clone in Flash
ActionScript
1
star
13

SpriteKitSimpleGame

Ray Wenderlich Tutorial - Objective C converted to Swift http://www.raywenderlich.com/42699/spritekit-tutorial-for-beginners
Swift
1
star
14

multisaurus

multisaurus
1
star
15

AndroidThinkful

Android Thinkful resources
1
star
16

circularDependency

Swift
1
star
17

BorderedView

Custom View with corner radius and border
Swift
1
star
18

MVCexperiment

A little example examining different strategies of handling data in a UIView and MVC/OOP challenges
Swift
1
star
19

DynamicCellHeight

Table View with Dynamic Cell height
Swift
1
star
20

Balance

Balance
Swift
1
star
21

TodoList

TodoList
Objective-C
1
star
22

BeginningCoreImage

Ray Wenderlich tutorial converted to Swift - Beginning Core Image in iOS 6
Swift
1
star
23

HouseHunter

Swift
1
star
24

Contacts

Swift
1
star
25

AudioKitBug

Audio Kit Bug?
Swift
1
star
26

BookCase

Record the books in your book case
Swift
1
star