-
Notifications
You must be signed in to change notification settings - Fork 68
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Sequence with repeat_count #79
Comments
Yes i don't think we support appending a finite and an infinite tweenables, because although that looks fine when playing forward, there's all sorts of undefined behaviors when playing backward or seeking to a particular point. I'm still perplex on the actual error though, looks like a bug. |
i ran into this recently as well. The regression was introduced here. When the mirrored tween hits the end and turns backwards, tween.elapsed will be larger than tween.duration and the result of the subtraction will be negative, causing an overflow (duration is unsigned and can't be negative). Reverting the line seems to fix the issue, but I'm not sure what implications that has, since i imagine it was changed for a good reason. |
I mean, we could revert that I guess, but again that doesn't solve the design question of "what do we do when the mirrored tween reaches back its start point?". If we mirror again then we're stuck on that tween, and any other tween in the |
Just a thought - wouldn't it make sense to add a For the finite repetitions I think Sequence should handle them. When played forward and mirror their behaviour when played backwards. |
If I understand correctly, what you're proposing is that the
Is that correct? This is a nice idea, but I'm concerned it breaks some invariants. For example, suppose I create such a But that made me think about an alternative. Ignore
I think that this way the behavior is deterministic. The user can make errors still, and possibly get confused, but the mental model should be simple and clean enough that with (hopefully in a close future) some UI / tooling / Editor that user would immediately see their mistake. I'm also even considering adding introspection so that we can now what exact type a tweenable is, and emit warnings when detecting mistakes. Any though on this @enaut and @sibsibsib ? |
Any the way this issue is a duplicate of #16, but the discussion here is interesting so leaving it open. |
The Your second option is basically what I expected. But maybe the cleaner solution would be to add another type. So Sequence::finally(self, infinite:tweenable )->InfiniteSequence{…} That |
I think keeping the .then() interface and maybe issuing a warning is probably fine. It fits my mental model that if i insert an infinite tweenable in the middle of a sequence that the sequence won't complete. My use case was very similar to the one enaut posted: I wanted some text to fade in and then pulse between two colors infinitely Out of curiosity, I took a look at how greensock (a very mature JS tweening library) handles the situation, and it has some interesting behavior. Any infinite tweens within the sequence will start looping, but tweens that occur after will be triggered at their appropriate start point. On top of that, the parent's repeat settings are effectively ignored, since the whole sequence never reaches the end. For example, for a sequence of |
Hey,
I was trying to have an object zoom into existence then wiggle infinitely... I tried doing that with:
But when Running the first animation works well, however the second one panics with:
The same happens if
repeat_count
is set to a finite number even when set to1
.It might be that this is "known" or "intended" but if so it should probably be in the documentation for the
then
method or theSequence
type.The Behaviour I expected would have been an infinite sequence first the zoom then forever wiggling...
The text was updated successfully, but these errors were encountered: