0
我想能夠被動補間我的對象上的屬性,以便在補間期間,我可以更新此對象和TweenLite將繼續。被動補間屬性與tweenlite
例如,以下代碼將在15秒內將對象中的座標從0
調到15
。在發生這種情況的同時,我還想更新x
和y
變量target.position
,我不能這樣做,因爲TweenLite似乎在完成之前(如在,直到15秒過去之後)「佔據」對象。
// target.position starts at { x:0, y: 0 }
TweenLite.to(target.position, 15, {
x: 15,
y: 15,
ease: Power4.easeOut
})
// for examples sake i'd like to do the following, yet it does not have an effect
setTimeout(function(){ target.position.x += 10 }, 1000)
setTimeout(function(){ target.position.y += 15 }, 2500)
setTimeout(function(){ target.position.x -= 17 }, 7500)
你應該看看最新的** ** ModifiersPlugin公佈的剛剛(** [鏈接](https://greensock.com/1-19 -0 /)**)。它可以幫助你修改當前正在運行的補間。 –
有趣的方法謝謝。 – bitten