-
-
Notifications
You must be signed in to change notification settings - Fork 21.9k
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 transition parameters to Tween #82155
base: master
Are you sure you want to change the base?
Conversation
25a2ff6
to
db4e5da
Compare
Thanks, I pushed the parameters for elastic transition. I renamed amplitude to damping, because it seems to have reverse effect. Here's elastic with different parameters: 5WLq8Nf6gO.mp41 is default, 2 is period 0.1, 3 is amplitude 5 Seems like the third parameter is now unused, so I guess I will be removing it. |
db4e5da
to
9f7af15
Compare
Ok I removed the third parameter. I also tried to de-hardcode the parameter count. While I can't do much about the arguments, I made arrays use a constant and also changed easing equations to use a macro (the method definitions are super-repetitive). The nice thing about the new parameters is that, as long as their count remains constant, we can tweak other easings without breaking compatibility at all. So if TRANS_SPRING or any other transitions were to use the parameters, it can be added at any point. The PR is more or less finished now. |
8041240
to
04d0734
Compare
04d0734
to
30aead2
Compare
130b80c
to
5726065
Compare
This looks good, but would it be too many arguments to take into account what I commented on in #82306 (comment)? In that case, I am a little wondering what the order of the arguments should be. Would it be best to make a structure for the Tween parameters, but since there is no way to expose the structure directly to GDScript, would it be fine to make it RefCounted? There was a similar discussion in #87171 (comment). At least those static functions are not exposed to GDScript, so there should be no problem using the structure internally, but if we want to expose this to GDScript (or indirectly, like play_with_capture()), I don't have an answer as to how to handle such a case with many arguments/returns yet... We hope godotengine/godot-proposals#7329 is implemented soon. |
@TokageItLab I could add another method similar to As for #82306, I'd just put the custom interpolator at the end. There isn't any argument limit in functions, it only affects convenience. |
62950c3
to
e9dd187
Compare
CI fails on compatibility, not sure how to handle it. There was no |
The file is |
e9dd187
to
826db13
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Functionally, it makes sense. Nevertheless, I leave it to the product team to discuss whether this is the correct way to pass additional arguments.
826db13
to
c6f4017
Compare
c6f4017
to
04fb741
Compare
Looks like using |
Closes godotengine/godot-proposals#7802
tbh this change makes the code more complex than it's probably worth it. I don't think there is better way though; I didn't want it to affect performance.
TODO:
figure outIt doesn't use them?amplitude
,period
for BACK equationsfigure outIt'sovershoot
,amplitude
,period
for ELASTIC equationsperiod
anddamping
now.I'll need help with the equations. I did
overshoot
for TRANS_BACK, because it was obvious. I'd appreciate if someone could just drop me implementations for other equations >_> (I have no idea about these numbers)Here's BACK with default overshoot and 5
godot.windows.editor.dev.x86_64_8ckv8JHLDB.mp4