How to apply different easing effects to sprite action?

后端 未结 2 637
遥遥无期
遥遥无期 2020-12-24 03:56

I use a lot of CCEase* functionalities in Cocos2D described here. iOS 7 Sprite Kit also have SKActionTimingMode.

2条回答
  •  别那么骄傲
    2020-12-24 04:49

    For arbitrary easing, Kardasis' answer says it all.

    If you're looking for an easy way to add a bouncing effect to your animations, that is consistent with the way things are done in UIKit, I have something for you.

    Apple introduced spring animations in UIKit a couple years ago, by letting you set a spring damping and initial velocity when performing a UIView animation. Unfortunately they didn't implement that in SpriteKit, so I made my own library that does just that.

    It's a set of extensions on SKAction that replicate most factory methods, adding the damping and velocity parameters.

    The code is on GitHub, feel free to use it: https://github.com/ataugeron/SpriteKit-Spring

提交回复
热议问题