Giter Site home page Giter Site logo

Comments (6)

GoogleCodeExporter avatar GoogleCodeExporter commented on September 13, 2024
[deleted comment]

from java-universal-tween-engine.

GoogleCodeExporter avatar GoogleCodeExporter commented on September 13, 2024
[deleted comment]

from java-universal-tween-engine.

GoogleCodeExporter avatar GoogleCodeExporter commented on September 13, 2024
[deleted comment]

from java-universal-tween-engine.

GoogleCodeExporter avatar GoogleCodeExporter commented on September 13, 2024
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.

GoogleCodeExporter avatar GoogleCodeExporter commented on September 13, 2024
[deleted comment]

from java-universal-tween-engine.

GoogleCodeExporter avatar GoogleCodeExporter commented on September 13, 2024
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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.