Tween 动画

来源:互联网 发布:单页seo卖产品 编辑:程序博客网 时间:2024/05/16 13:45
  • 网上有人比较各tween开源包的效率:从执行效率上来说,TweenLite》TweenMax》Tweener》Tween,而且前2个比后2个在大型运算中快不止一点点。 
大概就是这么个逻辑:
  • time:缓动经历过的时间
  • beforeMove:起始位置
  • changeDistance:起始位置与目标位置的距离,也就是距离上的一个变化量
  • duration:我们要求对象从起始位置移动到目标位置所需的时间,也就是缓动的总时长
主要是这个公式:pos = changeDistance * (time/duration) + beforeMove

一些参考文章:

TweenLite 参数说明 中文翻译 http://blog.5d.cn/user12/dzxz/200808/497831.html

https://greensock.com/gsap-as
customease https://greensock.com/customease

原来Tween缓冲是这么回事  http://zengrong.net/post/1151.htm




0 0
原创粉丝点击