Closed GoogleCodeExporter closed 9 years ago
That's not a bug, that's a feature :p
Actually you're keeping a reference to the Timeline "t" long after it's been
destroyed and reset by the manager. Therefore, when you call "kill()" on it,
you're killing a random timeline which is waiting in the pool. When you create
the second timeline, the engine reuse the first object, but it is already
killed and so is immediately sent back to the pool by the manager.
Actually you found a bug. In previous versions of the engine, I reset the
tweens/timelines on pooling but also on unpooling. I removed the latter in last
revision without considering your specific example.
Thanks for letting me know, I'll change this behavior so that manipulating
objects that are in the pool won't have any effect.
Original comment by aurelien.ribon
on 19 May 2012 at 7:17
Fixed in last commit. Tweens and timelines are reset each time they are
unpooled.
Original comment by aurelien.ribon
on 19 May 2012 at 7:25
Thanks!
I was starting to think it must be that. I sent you a PM on the badlogic forums
yesterday to that effect. There is still a question of how to safely cancel a
timeline that may already have completed. It may already have been unpooled and
in use. One workaround could be to set theuser data of your timeline to a
private member variable, then check if it still equal to that before
cancelling. Maybe it would be worth putting in a TweenManager.killKey or
something, so you can cancel a specific (group of) timeliness and/or
Tween.calls safely (since killTarget dooesnt work in this case)?
Thanks again for thebawsome lib!
Original comment by felixwatts
on 19 May 2012 at 7:42
I answered that in libgdx forums, check your messages :)
Original comment by aurelien.ribon
on 21 May 2012 at 7:11
Original issue reported on code.google.com by
felixwatts
on 16 May 2012 at 2:53