ijeomamotion TweenSequence issues
in
Contributed Library Questions
•
2 years ago
Hi All!
Im using the ijeomamotion tween library to handle the movement of some PGraphic objects on the stage. I am using the TweenSequence class to setup three (intro, across, and outro) tweens to play in sequence for each object. have three different objects I want to animate so I have an Array of TweenSequences that holds each of the sequences for the different objects. each object is taking a slightly different path and has slightly different timing, so it is important to keep them septate. then in the draw loop I loop through the tweensequences and move the object they are attached to.
here's how I set one of them up:
- ts[0] = new TweenSequence();
- ts[0].appendChild(new Tween(0, 33, 2, MotionConstant.SECONDS, 0, MotionConstant.QUART_EASE_OUT));
- ts[0].appendChild(new Tween(33, 66, 10, MotionConstant.SECONDS, 0, MotionConstant.SINE_EASE_BOTH));
- ts[0].appendChild(new Tween(66, 100, 2, MotionConstant.SECONDS, 0, MotionConstant.QUART_EASE_IN));
and in my draw loop I grab the current tween of the sequence and the position of that tween, then calculate where the object should be and finally draw the object to stage.
- float curTime = ts[i].getCurrentTween().getPosition();
- println("Current time : "+curTime);
- float pos = tweenStart[i]+(startEndDif[i]*(curTime/100));
- image(EstoryArray[sn], pos, tweenY);
the problem is, it seems like on occasion, the current tween of the sequence gets reset before the position is reset. here's the println trace that is happening to describe the problem:
- ...
- //all going well, animating nicely
- Current time : 32.871094
- Current time : 32.9472
- Current time : 32.983295
- Current time : 32.9967
- Current time : 32.999794
- //about to have problems
- Current time : 66.0 //this is the end value for the next tween in the sequence
- Current time : 66.0 //and again
- //back to normal here
- Current time : 33.03256
- Current time : 33.073227
- Current time : 33.130108
- Current time : 33.20314
- Current time : 33.29226
- ...
if it happened once, I could maybe understand maybe it sets the current tween on one draw loop then grabs the value the next loop, but for it to happen twice in a row seems strange.
any thoughts?
thanks!
ak
1