Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

addBarrier behaves different in Java and HTML #70

Open
tulsidas opened this issue Dec 15, 2014 · 0 comments
Open

addBarrier behaves different in Java and HTML #70

tulsidas opened this issue Dec 15, 2014 · 0 comments

Comments

@tulsidas
Copy link

I have this snippet of code:

  float DUR = 600;

  fanim.tweenScale(photo).to(0.25F).in(DUR).easeInOut();
  fanim.tweenXY(photo).to(-10, 370).in(DUR).easeInOut();
  fanim.tweenRotation(photo).to(-FloatMath.PI / 8).in(DUR);

  fanim.addBarrier(333); // wait for the current animations to finish and then wait another 333 ms

  fanim.tweenXY(photo).to(-300, 270).in(DUR).easeOutBack();
  fanim.tweenRotation(photo).to(-3 * FloatMath.PI).in(DUR);

The desired behaviour is to scale, move and rotate the photo (an ImageLayer) all three at the same time, then afterwards wait 333 ms, then again move and rotate it out of the screen.

In Java this works ok, but when I export to HTML, it doesn't wait the 333 ms between the two sets of animations

I set up a minimal project in github that showcases the problem:
https://github.com/tulsidas/tripleplay-barrier-demo

The code is extracted from the game that originated the problem.

There is a standard animation moving a circle, and if you click anywhere, it will take a snapshot of the screen and animate it.

On the java version it works properly, the snapshot goes to the corner, waits ~3 seconds, then goes away, but on the HTML backend it goes to the corner and immediatly goes away (not waiting the ~3 seconds)

I tried it both in Chromium 37 and Firefox 31, same wrong behaviour in both.

Looking and debugging into the JS generated code (attached) it seems (I'm mostly guessing) that the noActiveAnims flag (line 7878) is being wrongfully set to true when the "main" anim finishes, hence removing the secondary anim (the snapshot one) from the queue, and that's why it never finishes the waiting

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant