-
-
Notifications
You must be signed in to change notification settings - Fork 21.5k
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
[3.x] Backport the new Tween system as SceneTreeTween
#60581
Conversation
|
I searched for the filename before copying, didn't expect it's a .cpp file on
Like the enums, |
I've been writing the same boilerplate code so many times, I look forward to this being in 3.x as soon as possible! A nice way to ease the transition to this new way of doing Tweens. |
Awesome! I was thinking about doing this, but never got around to it.
You could pass the binds as array. That's what 4.0 Tweens did originally before Callable.bind() was added.
4.0 easing equations work exactly the same, I just changed some code that could cause undefined behavior (e.g. #28177). |
ec294e4
to
4b24044
Compare
Aside from the comment above, it should be fine now. |
Co-authored-by: Tomasz Chabora <kobewi4e@gmail.com>
Thanks! |
<signal name="finished"> | ||
<description> | ||
</description> | ||
</signal> |
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.
This description is missing for some reason.
@timothyqiu
Backports #41794 and later updates.
Like we have both
Timer
andSceneTreeTimer
, the new Tween is backported asSceneTreeTween
, so it does not break compatibility.As it's expected to be created from
get_tree().create_tween()
/node.create_tween()
, it does not matter what the class is called 😛Some notes:
interpolate_value()
was recently changed to a static function onmaster
, it's kept as a member function here.Callable
is not available on3.x
, so this type of parameter is changed to atarget
and amethod
.tween_callback()
takes up to 8 additional args that'll be passed to the method.tween_method()
can only be called on methods that takes one parameter (Same asTween.interpolate_method
)tween_callback()
andtween_method()
also takes an optionalbinds
array for parameter binding.TweenPauseMode
enum is added, other enums usesTween
's version directly.scene/animation/easing_equations.h
is copied frommaster
.