-
-
Notifications
You must be signed in to change notification settings - Fork 21.3k
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 TRANS_SPRING
interpolation option to tweens
#58999
Conversation
Thanks for opening a pull request 🙂 Feature pull requests should be associated to a feature proposal to justify the need for implementing the feature in Godot core. Please open a proposal on the Godot proposals repository (and link to this pull request in the proposal's body). |
From what you said about spring transition, it has some parameters to customize it. Is it possible to tweak it, so that it doesn't behave the same with different eases? The PR looks good otherwise. |
https://humpf.etienne.tech/article this was just to kinda show how it works...
Thanks. |
Well, currently Tweens don't support easing/transition parameters, because there was no need. Adding a new transition type that fits the current system is ok, but any more than that... It'd need some specific tweening functions, and they can be implemented in GDScript using method tweening. Supporting it in core would require some more changes. |
Based on @KoBeWi's review it seems that a proper solution would need more complex changes than proposed here. Either way it's not breaking compat and won't break compat, so we can bump it to |
That is fine, because this code/proposal does not need any new parameters and fits perfectly into the existing system with no changes.
That is what I did. Added a new transition that fits the current system. It has been tested and works in the linked pull request. as can be seen the in gifs. What other functions does it need? The linked article is not the proposal... just showing what a spring tween looks like.
I do not think that is the case... I think there was a misunderstanding when I posted that article but this is a simple four line function with the same parameters and inputs and outputs as all the other tween functions... the missing spring tween
I am not sure exactly how it works or what your are asking but it does seem to 'spring' more if the point are further away already Thanks. |
This looks like a great function that I think belongs in the base system, being a very common transition type. @rakkarage You should squash your commits into one. |
Either way, it's not blocking 4.0. It needs to be reviewed by a maintainer of the area (likely @KoBeWi himself). It also needs to be rebased and squashed, as mentioned above. |
This &spring::out, &spring::out, &spring::out, &spring::out }, // Spring is the same for each easing. Can you come up with different easing for in, in/out and out/in, by tweaking the parameters? So that the transition doesn't use the same function for each easing. |
Thanks. I will try to squish. &spring::out, &spring::out, &spring::out, &spring::out }, // Spring is the same for each easing.
no i do not think i can... it always springs at end and I think that makes sense logically... Other tween (linear) behave same way |
Linear has single easing, because it's impossible to tweak it. But spring does have some parameters, so it should be possible. If it's not easy to do then it's probably ok to have it like this for now. But it should be mentioned in the docs. |
Don't refork. Just squash or fixup. Also rebase. Really you should read the whole page. |
You need to rebase this PR and squash your commits. Your PR must only contain one commit that only includes your changes. Currently it contains unrelated changes, probably because you merged |
TRANS_SPRING
interpolation option to tweens
thanks... |
@rakkarage At the top of the PR, it says "Commits |
@rakkarage You seem to have reset too much and the all commit are gone. I recommend opening the PR again as new PR. |
Make sure to open it on a new branch that isn't |
Please consider adding this sping tween.
I really miss it.
I am not sure where this easing function came from?
I think I first saw it in iTween for Unity. https://github.com/jtothebell/iTween/blob/master/iTween.cs
It is similar to back or elastic but different enough to notice and seems better suited for ui elements like when OSX and iOS scroll a list past the end and 'spring' back?
Here is an animation from (https://www.protopie.io/learn/docs/interactions/animation-curves) just to show what it looks like kinda? This one is simpler with no parameters.
It only has one direction, out. Possibly more could be calculated for symmetry, but I don't think it would ever be used anyway, and that is the way I always 'find' the code.
Here is a very simple test project: https://github.com/rakkarage/TestTween (4.0 branch!)
Please & Thanks.