Closed GoogleCodeExporter closed 9 years ago
The problem is simple. The Tween class takes the properties of the sprite by
value,
and not by reference. that is the code:
int fFromValue = property.getAsFixed();
int fToValue = CoreMath.toFixed(toValue);
add(property, new Tween(fFromValue, fToValue, duration));
should be
int fToValue = CoreMath.toFixed(toValue);
add(property, new Tween(property.getAsFixed(), fToValue, duration));
And of course Tween object should be changed accordingly. Is there a reason not
to do
it, a reason I might be missing?
Original comment by elaz...@gmail.com
on 15 Jul 2009 at 8:04
All relative animation commands (moveTo, animateTo, etc) get the start value
from the moment the animation is
defined, rather than from the moment the animation runs. Changing this behavior
might not be trivial in some
cases, but it will be considered.
For a workaround, use the move() command instead of moveTo()
Original comment by brack...@gmail.com
on 15 Jul 2009 at 4:33
Here's a patch. I check whether or not the animation has started using the
`getSection()` method. I cache the previous section, and when the section
changes I
load the values.
Original comment by elaz...@gmail.com
on 19 Jul 2009 at 6:40
Attachments:
Thanks for the patch. I didn't use the exact code because it didn't include Int
or Color properties, or include unit
tests. But the fix is based off of the patch.
Original comment by brack...@gmail.com
on 3 Aug 2009 at 3:54
Original issue reported on code.google.com by
elaz...@gmail.com
on 15 Jul 2009 at 7:54