arashbi / java-universal-tween-engine Goto Github PK
View Code? Open in Web Editor NEWAutomatically exported from code.google.com/p/java-universal-tween-engine
Automatically exported from code.google.com/p/java-universal-tween-engine
What steps will reproduce the problem?
There are no way to reproduce the problem - it happens extremely rare and in
different places.
What is the expected output? What do you see instead?
IndexOutOfBoundsException when pushing to Timeline Tween.set() action
What version of the product are you using? On what operating system?
Android, different versions.
Please provide any additional information below.
I'm using TweenEngine in combination with libGDX. There are many animations in
our game - and this bug appears in different places.
Stack trace
java.lang.IndexOutOfBoundsException: Invalid index 161, size is 161
11-14 14:36:41.124: E/AndroidRuntime(7876): at
java.util.ArrayList.throwIndexOutOfBoundsException(ArrayList.java:251)
11-14 14:36:41.124: E/AndroidRuntime(7876): at
java.util.ArrayList.remove(ArrayList.java:399)
11-14 14:36:41.124: E/AndroidRuntime(7876): at
aurelienribon.tweenengine.Pool.get(Pool.java:21)
11-14 14:36:41.124: E/AndroidRuntime(7876): at
aurelienribon.tweenengine.Tween.set(Tween.java:284)
11-14 14:36:41.124: E/AndroidRuntime(7876): at
com.steelkiwi.bubblepiratequest.game.graphics.ScreenEffectsDrawer$BarrelPointsAn
imation.<init>(ScreenEffectsDrawer.java:327)
Original issue reported on code.google.com by [email protected]
on 20 Nov 2012 at 10:25
What steps will reproduce the problem?
1. see class below
What is the expected output? What do you see instead?
expected:
"hit begin callback"
actual:
"hit callback type 8"
What version of the product are you using? On what operating system?
6.3.2 Ubuntu
Please provide any additional information below.
Not sure if I'm doing something wrong here? It only seems to call the callback
on COMPLETE, even though I specified to only call at BEGIN.
The class below should illustrate the problem.
Thanks,
felix
import aurelienribon.tweenengine.BaseTween;
import aurelienribon.tweenengine.Tween;
import aurelienribon.tweenengine.TweenAccessor;
import aurelienribon.tweenengine.TweenCallback;
import aurelienribon.tweenengine.TweenManager;
public class Main
{
private static TweenCallback callbackAtBegin = new TweenCallback()
{
@Override
public void onEvent(int type, BaseTween<?> source)
{
if(type == TweenCallback.BEGIN)
System.out.println("hit begin callback");
else System.out.println("hit callback type " + type);
}
};
public static void main (String args[]) throws Exception
{
TweenManager manager = new TweenManager();
Tween.registerAccessor(MyClass.class, myAccessor);
Tween
.to(new MyClass(), 0, 1000)
.target(1f)
.setCallbackTriggers(TweenCallback.BEGIN)
.setCallback(callbackAtBegin)
.start(manager);
for(int n = 0; n < 1000; n++)
manager.update(1000f/60f);
}
private static class MyClass
{
public float val;
}
private static final TweenAccessor<MyClass> myAccessor = new TweenAccessor<Main.MyClass>()
{
@Override
public void setValues(MyClass target, int tweenType, float[] newValues)
{
target.val = newValues[0];
System.out.println("set value to " + target.val);
}
@Override
public int getValues(MyClass target, int tweenType, float[] returnValues)
{
returnValues[0] = target.val;
return 1;
}
};
}
Original issue reported on code.google.com by felixwatts
on 22 Jun 2012 at 1:47
What steps will reproduce the problem?
Animate e.g. 3 Sprites along a path with a construct like this:
Timeline timeline = Timeline.createSequence()
.beginParallel()
.push(Tween.to( sprite1...))
.push(Tween.to( sprite2...))
.push(Tween.to( sprite3...))
.end()
.beginParallel()
...
.end()
.beginParallel()
...
.end()
.delay(delay)
.repeatYoyo(25, 0.5f)
.setCallbackTriggers(TweenCallback.COMPLETE)
.setCallback(cb)
.start(tweenManager);
2. Everything before the animation is repeated backward works fine. When the
animation is played backwards, graphical glitches occur with non correct
blitting of the sprites.
3. This effect doesn't occur if the parallel tweens are organized in their own
timelines. Means one timeline for one sprite. The same construct without
beginParallel() etc.
What version of the product are you using? On what operating system?
6.3.3
Please provide any additional information below.
I could make a video and send it to you, if you don't get me :).
Best regards
Ron
Original issue reported on code.google.com by [email protected]
on 3 Sep 2012 at 10:14
use Timeline, both repeat and repeatYoyo dispatch only BEGIN, START, END,
COMPLETE, no BACK_* are dispatched.
Original issue reported on code.google.com by [email protected]
on 7 May 2013 at 9:14
Request to add 'synchronized callback' trigger after all interpolations have
been performed.
See thread here:
http://www.aurelienribon.com/forum/viewtopic.php?f=5&t=675
--tim
Original issue reported on code.google.com by [email protected]
on 14 Oct 2012 at 12:51
I'm using Tween Engine extensively in my game and 5.2 causes a weird problem.
It doesn't appear every time, so I can't provide any specific steps to
reproduce it.
Here's the stacktrace:
Exception in thread "LWJGL Application" java.lang.IndexOutOfBoundsException:
Index: 1, Size: 1
at java.util.ArrayList.RangeCheck(ArrayList.java:547)
at java.util.ArrayList.get(ArrayList.java:322)
at aurelienribon.tweenengine.TweenManager.update(TweenManager.java:196)
I think the problem is that you're declaring n=tweens.size() inside the for
loop. I know it's in the initialization step and SHOULD be executed once, but
it seems it's not the case. Putting this before the loop fixed the problem.
I changed:
public final void update(int deltaMillis) {
for (int i=0, n = tweens.size(); i<n; i++) {
to:
public final void update(int deltaMillis) {
int n = tweens.size();
for (int i=0; i<n; i++) {
Original issue reported on code.google.com by Thotep
on 9 Nov 2011 at 10:16
It wouldn't be such a big deal if maven could link to local (or remote) jars,
but that is only possible when dependency scope is set to system.
The current workaround is to manually install the jar into the local repository:
mvn install:install-file \
-DgroupId=com.aurelienribon \
-DartifactId=tween-engine-api \
-Dpackaging=jar \
-Dversion=6.3.3 \
-Dfile=tween-engine-api.jar \
-DgeneratePom=true
This complicates project management when working in teams or on multiple
computers.
Original issue reported on code.google.com by [email protected]
on 20 Mar 2013 at 12:27
That makes it impossible to pause and resume a tween.
Example:
I have some infinite animations in my game. User pauses the game and after a
few seconds resumes it. System.currentTimeMillis() is quite different from the
last value remembered by tweens and they go boom.
Possible solution: add update(delta) methods to Tween and TweenManager (where
"delta" means time since last update) and use this delta to decrease
Tween.durationMillis. If durationMillis <= 0 -> end of tween. Tween.update() (a
variant without arguments) could stay (nobody likes it when API breaks...) and
calculate the delta using System.currentTimeMillis() and previous value.
Original issue reported on code.google.com by Thotep
on 31 Oct 2011 at 10:52
What steps will reproduce the problem?
1. Create Several Object to be tweened
2. call TweenManager.getRunningTimelinesCount() before every tween creating(
this must happen even during animations)
3. Keep doing animation until the exception happens
What is the expected output? What do you see instead?
We receive a array out of bounds exception during
tweenManager.getRunningTimelinesCount().
What version of the product are you using? On what operating system?
6.3.3 on Android
Please provide any additional information below.
The method have this line of code:
"for (int i=0, n=objs.size(); i<n; i++)"
But during the for loop, it seems that an Tween has ended and are removed from
the "objs" array, causing the array out of bounds.
Original issue reported on code.google.com by [email protected]
on 31 Aug 2012 at 12:58
What steps will reproduce the problem?
1. Create a Tween with a an associated COMPLETE callback.
2. Run the tween and breakpoint the callback method "onEvent"
3. The onEvent parameter "BaseTween source" is always null.
What is the expected output? What do you see instead?
I would expect to see the BaseTween source reference.
What version of the product are you using? On what operating system?
Version 6.0.0
Please provide any additional information below.
The call method "callCallbacks" in the BaseTween class should pass "this" as a
parameter instead of null i.e.
protected void callCallbacks(EventType type) {
List<TweenCallback> callbacks = null;
switch (type) {
case BEGIN: callbacks = beginCallbacks; break;
case START: callbacks = startCallbacks; break;
case END: callbacks = endCallbacks; break;
case COMPLETE: callbacks = completeCallbacks; break;
case BACK_START: callbacks = backStartCallbacks; break;
case BACK_END: callbacks = backEndCallbacks; break;
case BACK_COMPLETE: callbacks = backCompleteCallbacks; break;
}
if (callbacks != null && !callbacks.isEmpty())
for (int i=0, n=callbacks.size(); i<n; i++)
callbacks.get(i).onEvent(type, null);
}
Original issue reported on code.google.com by alistair.rutherford
on 1 Feb 2012 at 4:19
What steps will reproduce the problem?
1. Create a new Android project
2. Add tween-engine-api.jar to the project's build path
3. create a TweenManager object in the main activity
What is the expected output? What do you see instead?
I'm having a java.lang.NoClassDefFoundError:
aurelienribon.tweenengine.TweenManager during runtime, although eclipse
found all the Tween classes in the autocomplete.
What version of the product are you using? On what operating system?
tween-emgine-api version 6.3.2. I'm using android 2.1, but i also gives me
error on other versions
Please provide any additional information below.
I weird because there is the TweenManager.class in the jar file and it is
already in the build path. I'm try it by inserting the source code instead of
the jar, and it works flawlessly.
Original issue reported on code.google.com by [email protected]
on 28 Jun 2012 at 2:22
The method should also prevent callbacks from being fired (maybe optionally).
Original issue reported on code.google.com by aurelien.ribon
on 30 May 2012 at 7:58
E.g. a new TweenManager(int size) constructor and Tween.setPoolSize(int size).
Currently both are hardcoded at 20.
Original issue reported on code.google.com by Thotep
on 31 Oct 2011 at 10:56
(version 6.33)
Timeline.createSequence()
.push(tween1)
.beginParallel()
.push(tween2)
// ...
.end()
.repeatYoyo(1,0)
.start();
When playing reversed, tween2 jumps back to it's target value when finished.
Minimal running example attached. Outputs to terminal
java -jar MinimalExample.jar
Original issue reported on code.google.com by [email protected]
on 30 May 2013 at 8:16
Attachments:
Hi,
Did you ever think to have tweens with a constant velocity instead of constant
time?
I suppose that will be difficult using ease or way points, but just linear
tweens will be very useful.
Also won't be obvious with combined attributes: what does "velocity" means in
these cases?. This can be solved implementing the "velocity definition" in
TweenAccessors.
I can help with it, just need some inputs.
Original issue reported on code.google.com by [email protected]
on 10 Feb 2013 at 9:32
What steps will reproduce the problem?
1. Timeline.createSequence
2. push tween.to
3. push pause
4. push Tween.call
What is the expected output? What do you see instead?
Expected: Tween.call callback is called after tween and pause.
Actual: Tween.call callback never called.
What version of the product are you using? On what operating system?
6.1.1 linux
Please provide any additional information below.
Original issue reported on code.google.com by felixwatts
on 15 Apr 2012 at 7:43
What steps will reproduce the problem?
1. Create Several Object to be tweened
2. call TweenManager.getRunningTimelinesCount() before every tween creating(
this must happen even during animations)
3. Keep doing animation until the exception happens
What is the expected output? What do you see instead?
We receive a array out of bounds exception during
tweenManager.getRunningTimelinesCount().
What version of the product are you using? On what operating system?
6.3.3 on Android
Please provide any additional information below.
The method have this line of code:
"for (int i=0, n=objs.size(); i<n; i++)"
But during the for loop, it seems that an Tween has ended and are removed from
the "objs" array, causing the array out of bounds.
Original issue reported on code.google.com by [email protected]
on 31 Aug 2012 at 12:56
What steps will reproduce the problem?
1.start an animation with repeatYoyo
-------------
What is the expected output? What do you see instead?
i scale an image from 1x to 2x,and repeatYoyo(1,0).
i wish it come back to 1x on the end,but it stoped at 1.2x
--------------------
What version of the product are you using? On what operating system?
6.3.3 on android
---------------
Please provide any additional information below.
here is some source code i wrote.
Tween scale = Tween.to(textSprite, SpriteAccessor.SCALE, 0.5f)
.target(3).ease(TweenEquations.easeNone)
.repeatYoyo(1, 0);
scale.start(Engine.graphics.getTweenManager());
case SCALE:
target.setScale(newValues[0]);
Engine.app.log(target.getScale() + "");
break;
and here is the print log.
Original issue reported on code.google.com by [email protected]
on 21 Jan 2013 at 6:09
Attachments:
Having a timeline inside a timeline, where the parent timeline yoyos causes
some errors. Before starting the yoyo repeat, it jumps to end values.
The fix is simple, and you can tell that it was a mistake. Since the original
programmer always has two sets of code for when the tween is going forward and
one for backward, but he did not change the line about the deltas. They just
need to be swapped.
Fix by replacing this code in Timeline.java:
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).update(dt);
return;
}
Original issue reported on code.google.com by [email protected]
on 2 Jun 2014 at 12:49
When building animations it would be nice if the asParallel and asSequence
methods ignored null values.
This would like you do this like this:
TweenGroup.asParallel(
tween1,
showTween2 ? tween2 : null,
showTween3 ? tween3 : null
)
The alternative code is much more cumbersome to generate and less efficient.
This is easily accomplished by changing code from this:
for (int i=0, n=tweens.length; i<n; i++)
group.groupables.add(tweens[i]);
to:
for (int i = 0, n = tweens.length; i < n; i++) {
Groupable groupable = tweens[i];
if (groupable != null) {
group.groupables.add(groupable);
}
}
Original issue reported on code.google.com by [email protected]
on 25 Aug 2011 at 1:30
What steps will reproduce the problem?
I don't know the exact steps to reproduce the bug
but in my case i have just tried to do 6 tweens and then
again 6 tweens on the same objects interpolating the same property on each of
theme
and the result was that the second time the first tween was not started/added
while
the others interpolated normally.
What is the expected output? What do you see instead?
I see all the 6 objects moving on screen the first time,
and just 5 of them (the first is the one not moving) the second time.
What version of the product are you using? On what operating system?
The last version 6.3.3 on Mac OSX 10.8.4
I did so many tests to check if this bug was related to my code.
I have also developed a small tween system and as result, using my code,
all the objects move both the first and the second time so i'm sure
this is related to the universal tween engine.
Furthermore i have seen some tweens just get discarded sporadicly and this
could be probably the general bug which should be fixed.
Original issue reported on code.google.com by [email protected]
on 26 Jul 2013 at 9:18
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
What steps will reproduce the problem?
1. Create a tween
2. add the method pushPause( 3000 ); //to wait 3000 millis according to javadoc
3. Tween executes presummaby 3000 seconds later instead of 3000 millis.
4. Changing it to pushPaus(3) produces the expected result.
What is the expected output? What do you see instead?
The tween should wait 3000 millis instead of 3000 seconds
What version of the product are you using? On what operating system?
http://www.aurelienribon.com/universal-tween-engine/javadoc/aurelienribon/tweene
ngine/Timeline.html
Please provide any additional information below.
Original issue reported on code.google.com by jeremyvillalobos
on 25 Aug 2014 at 5:29
What steps will reproduce the problem?
see class below.
What is the expected output? What do you see instead?
expected:
call #1
call #2
actual:
call #1
What version of the product are you using? On what operating system?
6.3.1
Ubuntu, java-6-openjdk-amd64
Please provide any additional information below.
As far as I understand it, the code below should cause the callback to get
called twice. When I run it I only get it called once. Am I doing something
wrong?
Thanks
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 TweenCallback callback = new TweenCallback()
{
private int n = 0;
@Override
public void onEvent(int type, BaseTween<?> source)
{
n++;
System.out.println("call #" + n);
}
};
public static void main (String args[]) throws Exception
{
TweenManager m = new TweenManager();
Timeline t = Timeline.createSequence()
.push(Tween.call(callback))
.start(m);
for(int n = 0; n < 1000; n++)
m.update(1);
t.kill();
t = null;
t = Timeline.createSequence()
.push(Tween.call(callback))
.start(m);
for(int n = 0; n < 1000; n++)
m.update(1);
}
}
Original issue reported on code.google.com by felixwatts
on 16 May 2012 at 2:53
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.