I google timedelta and found this from that
[QUOTE=tulamide]Don't think too complicated.
So you want two objects with different distances to destinationX to reach that point at the same time. lerp is perfect for that, because wherever you start, as soon as the t-value reaches 1, both will be at destinationX. All you need to do is raising the t-value from 0 to 1 over the period of time you want.
If you want a number to grow over time, you add n * timedelta to it. The maximum value of t is 1.0. How long do you want it last until 1.0 is reached? 'n * timedelta' equals 'amount per second'
To have it last 2 seconds, you'd add 0.5 * timedelta (2 * 0.5 = 1)
To have it last 5 seconds, you'd add 0.2 * timedelta (5 * 0.2 = 1)
+ some condition
-> myT = myT + 0.5 * TimeDelta
-> lerp(object1.x, destinationX, myT)
-> lerp(ScrollX, destinationX, myT)
Just make sure, myT isn't raised anymore, after 1.0 is reached.[/QUOTE] zyblade2012-06-26 19:19:03