cocoscreator缓动动作,比如easebackout自定义设置超出目标距离

this._easeBackOutObj = {

easing: function(time1) {

var overshoot = 0.90158;

time1 = time1 - 1;

return time1 * time1 * ((overshoot + 1) * time1 + overshoot) + 1;

},

};

let actMove = cc.moveTo(0.3, cc.v2(offsets[countX], 0)).easing(this._easeBackOutObj);

 

研究关于easebackout的底层代码,仿照重写一个_easeBackOutObj,重点在于根据需求设置overshoot的值。这样就可以实现自定义设置超出目标距离了

你可能感兴趣的:(cocoscreator缓动动作,比如easebackout自定义设置超出目标距离)