How to implement SKActionTimingFunction?

被刻印的时光 ゝ 提交于 2019-12-24 12:34:34

问题


How do you implement SKActionTimingFunction in objective-c?. I've looked everywhere and I just found an example in swift.

Thanks!


回答1:


heres an example

moveAction.timingFunction = ^float(float t){
    return sin(t * M_PI/2);
};

man i hate blocks in objective-c




回答2:


In Swift 4.2:

moveAction.timingFunction = { time -> Float in
    return sin(time * .pi/2)
}


来源:https://stackoverflow.com/questions/28520521/how-to-implement-skactiontimingfunction

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!