-
Notifications
You must be signed in to change notification settings - Fork 2
SequenceGroup stop() error #3
Comments
I take back what I said, it is not working as expected. Based on the behavior of BasicTween, stop() should act as a pause() function that will resume on start(). |
The root of this problem seems to be an implementation confusion of the intent of MotionEvent.ENDED. Is this event supposed to be fired when the tween has run through it's entire duration, or when the tween stops? Personally, I would expect it to be when the tween has run through it's entire duration because if a tween is stopped preemptively, it has to have been caused by an external call. Am I right? |
It seems that all events in the desuade motion package share similar event strings... this is likely the root cause of confusion in the system. If I give each event class unique event strings, the sequence functionality fails to complete... which likely means that a MotionEvent listener was being triggered by a dispatched TweenEvent. |
The behavior of BasicTween stop() is not to resume, it's to end. Tween does implement resume however. The ended event should work as expected, not being called when stopped with Tween, but called when stopped with BasicTween. There was no purpose in firing a different event when a tween is paused, because that will always be called in a script, so you know when it's called and don't need to be notified about it because you're calling it, right? Tween wont fire the ended event unless it's marked as completed, which it wont do if stopped in the middle of a tween. endFunc gets called when the Primitive 'dies', however this prevents it in Tween if not completed (BasicTween will fire it always since it doesn't support pause/resume):
|
calling stop() on a ClassSequence with nested SequenceGroups causes a null object reference on _current. Tracing through the code execution, calling stop() on a SequenceGroup causes serve() to get called, which after iterating through all the _current objects will automatically call end(). This causes _current to be set to null before the stop() function can finish executing. Additionally, there's a redundant end() being called inside the stop() function.
If I rewrite the stop function to read:
then the code will execute without throwing an error, and appears to be behaving as expected.
The text was updated successfully, but these errors were encountered: