如果我有一个运行时间为2000ms的tween,而我想在1000ms时提取tweened值,我该如何操作? 我正在使用Tween.js @ http://github.com/sole/tween.js。
var position = {y: 0};
t = new TWEEN.Tween(position)
.to({ y: 300 })
.onUpdate( function() {
console.log(position.y);
});
t.start(); // correctly runs the tween and logs tweened position.y values
现在,从我所了解的情况来看,我应该能够使用 .update(tValue) 并在给定的 tValue onUpdate 时记录正确的缓动值。但实际上,position.y 只输出起始位置的值。
Github 页面的第一个常见问题提示有这个功能,但我似乎无法使其正常工作。
谢谢!
getTweenedValue
的签名接口,另一个答案也稍微提到了这一点。 - J. Holmes