-
-
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.tween_subtween
method for nesting tweens within each other
#98660
base: master
Are you sure you want to change the base?
Conversation
`set_ease`, `set_trans`, and `set_delay` Documentation only for `set_delay` so far, since I have tested it
I was hoping to implement The way that var tw := create_tween()
tw.tween_property(self, "position:x", 100, 1.0)
tw.set_trans(Tween.TRANS_SINE) # no effect! The object would still move with linear motion, as if the
I might go and submit a separate PR to make this more clear. Anyways, because of this, the following doesn't work, at least in the way I would intuitively expect: Ref<SubtweenTweener> SubtweenTweener::set_trans(Tween::TransitionType p_trans) {
subtween->set_trans(p_trans);
return this;
} With this, if you start adding All this to say, while I think it would be nice to have support for methods like As such, for now I think I'll just go ahead with only having the |
Upon further investigation, the way they are implemented for Tween doesn't appear to work here
I've created a small project with several testing scenes, so people can see how it behaves and what the corresponding GDScript code is like: tween-subtween.zip I'll also add this to the original post so it's easily accessible. With this complete, I think the PR is ready to be more throughly looked at, so I'll open it for review!
|
This is an implementation of godotengine/godot-proposals#11022, which adds the
tween_subtween
method to theTween
class. Using this method,Tween
objects can be nested within each other and scheduled to play at specified points.It's not fully complete yet (see the to do list below), but I wanted to get a draft posted with the core functionality so that others could give their thoughts on it. I'm especially unsure about the method used to remove a
Tween
from theSceneTree
'stweens
list once it is made into a subtween.Example usage
Godot.Tween.Subtween.Video.1.mp4
Example project
tween-subtween.zip
Inside this project are several
*_test
folders; you can open them and run the scenes inside to see demos of the method in action.To do
Tween
s from theSceneTree
is okay, or improve it if necessaryTweener
subclassesInfeasible due to the way default transitions and tween evaluation is implementedset_trans
Infeasible due to the way default transitions and tween evaluation is implementedset_ease
set_delay
May be out of scope for now, and not necessary enough (possibly best to implement onset_custom_interpolator
Tween
itself?)Tween
features like loops, play, pause, etc doesn't break when in a parentTween
Tween.tween_subtween
Tween.play
andTween.pause
that a paused subtween will result in the parent tween never moving past that stepTween.set_loops
that an infinitely-looping subtween will result in the parent tween never moving past that stepTween.set_pause_mode
andTween.set_process_mode
that they will not have an effect when the tween is a subtweentween_subtween
method for nesting Tweens godot-proposals#11022