动作函数通常是这样的Actions.moveTo(x, y, duration),但这都是匀速运动,如果想实现“先快后慢”等功能,就要用Actions.moveTo(x, y, duration, interpolation)。
libGDX提供的Interpolation及其图像如下:
注:所有图像均遵循 x属于[0,1],对于范围外的图像请无视。
有两种颜色的图像是两个函数拼在一起,x区间分别是[0,0.5],(0.5,1],比如下图是[0,0.5]区间的绿色图像+(0.5,1]区间的红色图像;
Interpolation.circle;
Interpolation.circleIn;
Interpolation.circleOut;
Interpolation.fade;
Interpolation.linear;
Interpolation.pow2InInverse;
Interpolation.pow2OutInverse;
Interpolation.pow3InInverse;
通过以上图像发现,变量名中有In的,将图像旋转180度可以得到Out的图像。比如将Interpolation.pow3InInverse图像翻转180度可以得到Interpolation.pow2OutInverse的图像,接下来有Out的图像就不画了。
Interpolation.sine;
Interpolation.sineIn;
Interpolation.bounce;
这个逻辑比较复杂,没看懂。
Interpolation.elastic;
Interpolation.exp10;
Interpolation.exp5;
Interpolation.pow2;
Interpolation.pow3;
Interpolation.pow4;
Interpolation.pow5;
Interpolation.swing;