-
-
Notifications
You must be signed in to change notification settings - Fork 21.7k
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 an option for tweens to ignore Engine.time_scale
#100735
Add an option for tweens to ignore Engine.time_scale
#100735
Conversation
doc/classes/Tween.xml
Outdated
<return type="Tween" /> | ||
<param index="0" name="ignore" type="bool" default="true" /> | ||
<description> | ||
If [param ignore] is [code]true[/code], the speed of tweening will not be affected by [member Engine.time_scale]. This affects all [Tweener]s and their delays. Default value is [code]false[/code]. |
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.
Mixture between this PR's description and #100736 's which is taken from Timer and/or SceneTreeTimer, I believe, so it's consistent.
If [param ignore] is [code]true[/code], the speed of tweening will not be affected by [member Engine.time_scale]. This affects all [Tweener]s and their delays. Default value is [code]false[/code]. | |
If [param ignore] is [code]true[/code], the tween will ignore [member Engine.time_scale] and update with the real, elapsed time. This affects all [Tweener]s and their delays. Default value is [code]false[/code]. |
980ff19
to
00b1754
Compare
scene/animation/tween.h
Outdated
@@ -161,6 +162,8 @@ class Tween : public RefCounted { | |||
TweenProcessMode get_process_mode(); | |||
Ref<Tween> set_pause_mode(TweenPauseMode p_mode); | |||
TweenPauseMode get_pause_mode(); | |||
Ref<Tween> set_ignore_time_scale(bool p_ignore); | |||
bool is_ignore_time_scale() const; |
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.
In a similar PR that does the same thing to Timer
nodes, we went with get_ignore_time_scale
instead of is_ignore_time_scale
. See discussion here : #96626 (comment)
It would make sense to do the same here
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 is basically bikeshedding but I'd not be against is_ignoring_time_scale()
myself for both.
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.
I agree with the points in the discussion, but this method is not exposed, much like the one in SceneTreeTimer
.
From the other tween ignore time pull #100736 there is talk about general code cleanup in Tween. I think it would be a good idea to change is_ignore_time_scale
both here and in SceneTreeTimer
for consistency, alongside the other code polish.
I can implement it, but I'm not sure if this PR should encompass all that.
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.
I think it should be is_ignoring_time_scale
that's our usual formatting
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.
If we feel particularly strongly about it you could make a separate PR for Timer's before we no longer can @AThousandShips
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.
Absolutely will see if I can get that today
00b1754
to
dbc0cc1
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.
LGTM, will do the changes to Timer soon
Thanks! Congratulations on your first merged contribution! 🎉 |
Implements godotengine/godot-proposals#11404
Adds
.set_ignore_time_scale(ignore:bool)
method to tweens.Bugsquad edit: closes godotengine/godot-proposals#11404