SpriteKit SKAction easing

前端 未结 2 1085
攒了一身酷
攒了一身酷 2020-12-16 14:00

Well the title gives the question away, how can I apply easing to the SKAction node actions in SpriteKit?

I found that this works:

SKAction *moveActi         


        
2条回答
  •  再見小時候
    2020-12-16 14:36

    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

提交回复
热议问题