Does iTween support a speed variable for moving as opposed to time? Seems like that would be something that would be nice in iTween. We have game pieces and they move faster the farther away I want to move them because we just have a static time variable. Would be cool if I could just put a speed in there. I suppose I could get that value by finding the distance of dest to source and using a speed value to get the time it would take to get there, but seems like that could be something iTween does automatically.
I’ve been using iTween in my last project, but I haven’t seen any speed property for the methods… but I think one could extend the iTween script and add that, since it doesn’t look like a complicated calculation… instead of interpolating the tween transition over time, one would just increment the transition until it reaches the target value…
Hmm…
The trouble is that since iTween is static and has a heap of methods, it would be necessary to add a “speed” parameter to the hashtables of each method… and create a new transition equation for handling the transition based on speed
Well, It’s not impossible… it’s just not there yet ![]()
Cheers
I’m definatly considering a speed property in iTween 2.0 but it addeds a decent challenge to certain things, namely delay. Since you won’t know the length of time speed will calculate it will make it a nightmare to chain iTweens. I may just add it anyway and let the community work with a solution on the delay. Stay tuned.
True, I hadn’t considered the delay property…
Well, I’m assuming that the speed property is for those situations where there’s no need to control time, but rather the speed at which objects are moving at any given moment… for instance, in a slot car game, one could use a moveToBezier with a speed parameter and a list of track waypoints… timing the tween would be quite immaterial in this instance, but having control over speed would be essential.
Hmm, on that note, it could also be a good idea to add a callback to allow people to update the speed property as the tween progresses.
with those 2 features added, we would have almost an instant slot car game template there ![]()
of course, with an ever changing speed parameter, it would be straight up impossible to predict how long a transition would take… but as I see it, there is room for both methods… In time-based tweens, the speed is a result of the interpolation over time… In speed-based tweens, it would be the other way around.
Cheers
I can’t guarantee this will be in 2.0 but I’ll keep thinking about this…