我目前正在开发一个不包含 GSAP(Greensock 的 JS Tweening 库)的项目,但是由于使用它的可视化编辑器创建自己的自定义缓动函数非常容易 - 我想知道是否有办法分解所需的ease-function 以便可以在 CreateJS Tween 中重用?
例子:
var myEase = CustomEase.create("myCustomEase", [
{s:0,cp:0.413,e:0.672},{s:0.672,cp:0.931,e:1.036},
{s:1.036,cp:1.141,e:1.036},{s:1.036,cp:0.931,e:0.984},
{s:0.984,cp:1.03699,e:1.004},{s:1.004,cp:0.971,e:0.988},
{s:0.988,cp:1.00499,e:1}
]);
这样它就变成了这样的东西:
var myEase = function(t, b, c, d) {
//Some magic algorithm performed on the 7 bezier/control points above...
}
(下面是这种特殊缓动方法的图表。)