Skip to content
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

Improve Tween.set_ease and Tween.set_trans documentation #98689

Merged
merged 1 commit into from
Nov 12, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 16 additions & 4 deletions doc/classes/Tween.xml
Original file line number Diff line number Diff line change
Expand Up @@ -218,8 +218,14 @@
<return type="Tween" />
<param index="0" name="ease" type="int" enum="Tween.EaseType" />
<description>
Sets the default ease type for [PropertyTweener]s and [MethodTweener]s animated by this [Tween].
If not specified, the default value is [constant EASE_IN_OUT].
Sets the default ease type for [PropertyTweener]s and [MethodTweener]s appended after this method.
Before this method is called, the default ease type is [constant EASE_IN_OUT].
[codeblock]
var tween = create_tween()
tween.tween_property(self, "position", Vector2(300, 0), 0.5) # Uses EASE_IN_OUT.
tween.set_ease(Tween.EASE_IN)
tween.tween_property(self, "rotation_degrees", 45.0, 0.5) # Uses EASE_IN.
[/codeblock]
</description>
</method>
<method name="set_loops">
Expand Down Expand Up @@ -271,8 +277,14 @@
<return type="Tween" />
<param index="0" name="trans" type="int" enum="Tween.TransitionType" />
<description>
Sets the default transition type for [PropertyTweener]s and [MethodTweener]s animated by this [Tween].
If not specified, the default value is [constant TRANS_LINEAR].
Sets the default transition type for [PropertyTweener]s and [MethodTweener]s appended after this method.
Before this method is called, the default transition type is [constant TRANS_LINEAR].
[codeblock]
var tween = create_tween()
tween.tween_property(self, "position", Vector2(300, 0), 0.5) # Uses TRANS_LINEAR.
tween.set_trans(Tween.TRANS_SINE)
tween.tween_property(self, "rotation_degrees", 45.0, 0.5) # Uses TRANS_SINE.
[/codeblock]
</description>
</method>
<method name="stop">
Expand Down