Comments (6)
[deleted comment]
from java-universal-tween-engine.
[deleted comment]
from java-universal-tween-engine.
[deleted comment]
from java-universal-tween-engine.
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 [email protected]
on 26 Nov 2013 at 1:26
from java-universal-tween-engine.
[deleted comment]
from java-universal-tween-engine.
When I tried solution 1, I found that the value at the end, after the tween had
fully run, was one step away from what it should be.
I believe the following simpler fix will sort that...
Instead of deleting the line, change it to updateOverride(step, step,
isIterationStep, delta);
i.e. Remove the +1 from the second argument.
Original comment by [email protected]
on 7 May 2015 at 9:39
from java-universal-tween-engine.
Related Issues (20)
- BEGIN callback not called for simple tween. HOT 2
- java.lang.NoClassDefFoundError HOT 3
- TweenManager.getTimelinesCount getting exception HOT 2
- TweenManager.getTimelinesCount getting exception HOT 8
- Synchronized callbacks
- Crash on Pool.get() HOT 4
- is there something wong with repeatYoyo?it cann't return to the start status. HOT 1
- Tweens with a constant velocity instead of constant time HOT 1
- Maven artifact HOT 3
- backward event callbacks not occur
- Value force set to target value instead of start value when playing backwards
- Sometime tween are not added/started HOT 3
- Found bug and fix
- public Timeline pushPause(int millis) documented to be in milliseconds when in fact in seconds
- BaseTween not passing reference to itself in the call back call. HOT 2
- callback in timeline never called. HOT 3
- Timeline (with callbacks) not repeated. HOT 9
- Callback not called after killing another timeline that called it. HOT 4
- Add a "setProgress(float [0..1])" method to BaseTween
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from java-universal-tween-engine.