JSDemos / java-universal-tween-engine

Automatically exported from code.google.com/p/java-universal-tween-engine
0 stars 0 forks source link

Timeline (with callbacks) not repeated. #7

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?

        Timeline.createSequence()
            .push(Tween.call(a.fireCallback))
            .pushPause(FIRE_DELAY)
            .push(Tween.call(a.fireCallback))
            .pushPause(FIRE_DELAY)
            .push(Tween.call(a.fireCallback))
            .repeat(Tween.INFINITY, RELOAD_TIME_MS)
            .start(Z.sim().tween());

What is the expected output? What do you see instead?

Expected: the callback a.fireCallback is called an infinite number of times.

Actual: the callback is called two (not even three!) times.

What version of the product are you using? On what operating system?

6.3.1 linux

Please provide any additional information below.

Original issue reported on code.google.com by felixwatts on 19 Apr 2012 at 5:51

GoogleCodeExporter commented 9 years ago
I'll try to replicate that and will tell you. May be caused with the infinite 
repetition of the timeline, I did not check that as heavily as I checked finite 
repetition sequences.

Original comment by aurelien.ribon on 19 Apr 2012 at 6:03

GoogleCodeExporter commented 9 years ago
Cheers!. FYI the issue also occurs for finite repititions and for repeatYoyo.

Original comment by felixwatts on 19 Apr 2012 at 6:09

GoogleCodeExporter commented 9 years ago
Can't reproduce your issue.

Test configuration: 3 Tween.call() separated with a 1s pause in a timeline.
You can see the whole test code, as well as the produced result here: 
http://pastebin.com/ATEqNPje

The three callbacks are called correctly during forward iterations.

Can you provide more information to help me debug your issue? What are the 
values of FIRE_DELAY and RELOAD_TIME_MS?

Original comment by aurelien.ribon on 19 Apr 2012 at 6:28

GoogleCodeExporter commented 9 years ago
Hi Aurelien,

here is a class that demonstrates the problem:

Expected output:

call #1
call #2
call #3
etc.

Actual output

call #1

import aurelienribon.tweenengine.BaseTween;
import aurelienribon.tweenengine.Timeline;
import aurelienribon.tweenengine.Tween;
import aurelienribon.tweenengine.TweenCallback;
import aurelienribon.tweenengine.TweenManager;

public class Main
{
    private static int _numCalls;

    private static TweenCallback callback = new TweenCallback()
    {

        @Override
        public void onEvent(int arg0, BaseTween<?> arg1)
        {
            System.out.println("call #" + ++_numCalls);
        }

    };

    public static void main(String[] args)      
    {
        TweenManager manager = new TweenManager();

        Timeline.createSequence().push(Tween.call(callback)).pushPause(1000).repeat(Tween.INFINITY, 0).start(manager);

        while(true)
        {
            manager.update(1);
        }
    }
}

Original comment by monkeyso...@gmail.com on 22 Apr 2012 at 7:24

GoogleCodeExporter commented 9 years ago
Testing exactly your code, I get:

...
call #9959
call #9960
call #9961
call #9962
call #9963
call #9964
call #9965
call #9966
call #9967
call #9968
call #9969
call #9970
call #9971
call #9972
call #9973
call #9974
call #9975
call #9976
call #9977
call #9978

...until I kill the program. I used the release 6.3.1 zip file. My IDE is 
Netbeans 7.1.1, with JDK 1.7.03 (forced to comply with source 1.6). What's your 
environment?

Original comment by aurelien.ribon on 23 Apr 2012 at 8:34

GoogleCodeExporter commented 9 years ago
Hi,

My environment:

API: tween-engine-api-6.3.1.zip  
IDE: Eclipse (Indigo)
SDK: JavaSE-1.6 (java-6-openjdk)

I tried switching to the java-6-sun-1.6.026 runtime (the only other one 
currently installed on my system) and got the same result.

Regards
felix (probably confusing you by posting from two different accounts :)

Original comment by felixwatts on 23 Apr 2012 at 9:32

GoogleCodeExporter commented 9 years ago
Regarding this previous test, can you please attach your whole eclipse project 
as a zip file so I can test with the same options as you? It's very intriguing.

Original comment by aurelien.ribon on 23 Apr 2012 at 12:23

GoogleCodeExporter commented 9 years ago
Hi,

OK, in putting together a project for you the problem disappeared. I think an 
older version of the tween engine must have been accidentally cross referenced 
of something :/

Anyway - problem solved - thanks for your time.

Original comment by felixwatts on 23 Apr 2012 at 1:12

GoogleCodeExporter commented 9 years ago
Glad it's okay :)

Original comment by aurelien.ribon on 23 Apr 2012 at 1:15