libGDX之Interpolation類學習筆記
阿新 • • 發佈:2018-12-21
動作函式通常是這樣的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
Interpolation.circleOut;
Interpolation.fade;
Interpolation.linear;
Interpolation.pow2InInverse;
Interpolation.pow2OutInverse;
Interpolation.pow3InInverse;
通過以上影象發現,變數名中有In的,將影象旋轉180度可以得到Out的影象。比如將Interpolation
Interpolation.sine;
Interpolation.sineIn;
Interpolation.bounce;
這個邏輯比較複雜,沒看懂。
Interpolation.elastic;
Interpolation.exp10;
Interpolation.exp5;
Interpolation.pow2 ;
Interpolation.pow3;
Interpolation.pow4;
Interpolation.pow5;
Interpolation.swing;