Skip to content
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

Fix next indicator slipping off screen #1827

Conversation

Pheubel
Copy link
Contributor

@Pheubel Pheubel commented Oct 26, 2023

Resolves #1809

When a new animation started, it would take the values left behind by the previous tween. By keeping a reference to the current animation tween we can ask it to clean up first before having a new tween take over.

@Jowan-Spooner
Copy link
Collaborator

Not entirely sure I understand why this fixes it, but it seems to work pretty well. So 💯 . Thanks for the work!

@Jowan-Spooner Jowan-Spooner merged commit c89b03e into dialogic-godot:main Oct 28, 2023
@Pheubel
Copy link
Contributor Author

Pheubel commented Oct 28, 2023

Not entirely sure I understand why this fixes it, but it seems to work pretty well. So 💯 . Thanks for the work!

I think the best way to explain it is to first explain why it broke in the first place. Before it would tween using the position of the indicator, it would change the position up and down. every time the text event got called it would look at it's current position and use that as it's origin for the tween, but because the position was on a different position due to the previous tween it starts slipping off.

So the root of the problem is that the start position of each tween is not equal. What needed to happen was that it got reset before the next tween would begin. If you look at the stop function on a tween object it says:

Stops the tweening and resets the Tween to its initial state.

This is exactly what needed to be done. All that there was left to do was keep a reference to the current tween so that we can call stop on it and reset it's position before starting the next one.

I hope this clears things up, @Jowan-Spooner

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Progress Indicator keeps lowering
2 participants