-
-
Notifications
You must be signed in to change notification settings - Fork 21.1k
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
Add Tween.interpolate()
as a low-level tweening option
#36997
Conversation
@dacrystal If you'd like, I can add you as a co-author to the commit. To do this, I need to know the name and email address you typically use with Git (the email address must also be associated with your GitHub account). |
Thanks man! IIRC, I just copy/paste most of the code from different parts of engine code. So I'm not sure if that considered a contribution.
|
Nice! This is a very appreciated addition since I often end up reimplementing this myself in gdscript for new projects. |
dbdc8e2
to
9dd396a
Compare
Are there any blockers for this to go through? I can help if needed. |
The main blocker is reaching a consensus on whether this is a good addition to the Tween API. The linked enhancement seems relatively popular and speaks in favor of the change. The implementation looks good, but I do have one concern over the semantic difference between this |
This can be used as an alternative to `Tween.interpolate_property()` when additional control is needed. This closes godotengine/godot-proposals#36. Co-authored-by: Nasser Alansari <alansari.n@gmail.com>
9dd396a
to
4a48745
Compare
@akien-mga I agree about the confusion. It does not need a node instance and definitely doesn't need to be in the scene tree, so it can be a static class method or a global function. All the other tween methods also require This is basically the equivalent of |
@asheraryam To my knowledge, GDScript doesn't have static methods for C++-provided classes. So we'd have to do it another way (e.g. a global scope method). |
@Calinou Yes that's fine too, I think this method would also fit very well as an extension of the It's much closer to |
@asheraryam Alternatively, could we add optional arguments to |
@Calinou I am ok with either option really. On one hand the current Regarding the [0..1] weights (and if we decide to extend There is rarely any sane case where values outside the range should be passed, so this salvaging makes sense. Edit: And we can document this clamping so advanced users can know what's wrong on the off chance they expect something different. |
Well But there could be an |
|
How would I go about exposing the current |
I guess the If that sounds messy, then I'd suggest we stick with this PR and choose a clearer name than |
Closing in favor of #41794, which is more likely to be merged for 4.0. |
This can be used as an alternative to
Tween.interpolate_property()
when additional control is needed.Thanks @dacrystal for providing the code for the method 🙂
This closes godotengine/godot-proposals#36.