Open GoogleCodeExporter opened 9 years ago
[deleted comment]
[deleted comment]
[deleted comment]
I encountered this issue yesterday when fooling around with the library. After
doing some debugging I've come to the conclusion the issue is only with the
TimeLine class, and when the delay of repeatYoyo is set to more than 0.
The issue occurs when the timeline is disabled(isIterationStep = false) but its
children remain enabled. This results in interpolations when the timeline
should in fact be waiting for the delay to be over.
I've come up with two "solutions" to fix the repeatYoyo functionality.
1. Inside BaseTween, navigate to updateStep(), find the following code:
} else if (isIterationStep && currentTime+deltaTime < 0) {
isIterationStep = false;
step -= 1;
float delta = 0-currentTime;
deltaTime -= delta;
currentTime = 0;
updateOverride(step, step+1, isIterationStep, delta);
callCallback(TweenCallback.BACK_END);
if (step < 0 && repeatCnt >= 0)
callCallback(TweenCallback.BACK_COMPLETE);
else
currentTime = repeatDelay;
}
delete updateOverride(step, step+1, isIterationStep, delta);
2. this solution requires a bit more work, but it doesn't simply remove a whole
call.
Inside BaseTween add the following method:
void setIsIterationStep(boolean step){
isIterationStep = step;
}
Inside Timeline in updateOverride() replace:
if (!isIterationStep && step < lastStep) {
assert delta <= 0;
float dt = isReverse(lastStep) ? -delta-1 : delta+1;
for (int i=children.size()-1; i>=0; i--) children.get(i).update(dt);
return;
}
With:
if (!isIterationStep && step < lastStep) {
assert delta <= 0;
float dt = isReverse(lastStep) ? -delta-1 : delta+1;
for (int i=children.size()-1; i>=0; i--) {
children.get(i).setIsIterationStep(false);
children.get(i).update(dt);
}
return;
}
Original comment by Hmedina....@gmail.com
on 26 Nov 2013 at 1:26
Original issue reported on code.google.com by
isaku...@gmail.com
on 3 Sep 2012 at 10:14