1/** 2 * 自定义Tween动画类 3 */ 4namespace TweenPro 5{ 6 export class Ease 7 { 8 constructor(){}; 9 /** 10 * asine out 11 * 缓动动画函数:先较快,后较慢,再较快 12 * @param t[0,1] 13 */ 14 static asinOut(t:number):number 15 { 16 //反正弦函数 17 return (Math.asin(0.96*2*t-1)+Math.PI/2)/Math.PI; 18 } 19 /** 20 * circOutTocircIn 21 * 缓动动画函数:先很快,后很慢,再很快 22 * @param t[0,1] 23 */ 24 static circOutToIn(t:number):number 25 { 26 if(t<=0.5) 27 { 28 return Math.sqrt(1 - (--t*2) * t*2); 29 } 30 else 31 { 32 return -(Math.sqrt(1 - 4*t * t) - 1); 33 } 34 } 35 } 36}
Egret之自定义Tween缓动动画函数
Stella981
2021-10-11
1159 0 0
点赞
收藏
评论区
加载中...