summaryrefslogtreecommitdiff
path: root/doc/classes/Tween.xml
diff options
context:
space:
mode:
Diffstat (limited to 'doc/classes/Tween.xml')
-rw-r--r--doc/classes/Tween.xml147
1 files changed, 49 insertions, 98 deletions
diff --git a/doc/classes/Tween.xml b/doc/classes/Tween.xml
index 4efb0a3309..372a6e7ebf 100644
--- a/doc/classes/Tween.xml
+++ b/doc/classes/Tween.xml
@@ -44,18 +44,15 @@
</tutorials>
<methods>
<method name="bind_node">
- <return type="Tween">
- </return>
- <argument index="0" name="node" type="Node">
- </argument>
+ <return type="Tween" />
+ <argument index="0" name="node" type="Node" />
<description>
Binds this [Tween] with the given [code]node[/code]. [Tween]s are processed directly by the [SceneTree], so they run independently of the animated nodes. When you bind a [Node] with the [Tween], the [Tween] will halt the animation when the object is not inside tree and the [Tween] will be automatically killed when the bound object is freed. Also [constant TWEEN_PAUSE_BOUND] will make the pausing behavior dependent on the bound node.
For a shorter way to create and bind a [Tween], you can use [method Node.create_tween].
</description>
</method>
<method name="chain">
- <return type="Tween">
- </return>
+ <return type="Tween" />
<description>
Used to chain two [Tweener]s after [method set_parallel] is called with [code]true[/code].
[codeblock]
@@ -67,10 +64,8 @@
</description>
</method>
<method name="custom_step">
- <return type="bool">
- </return>
- <argument index="0" name="delta" type="float">
- </argument>
+ <return type="bool" />
+ <argument index="0" name="delta" type="float" />
<description>
Processes the [Tween] by given [code]delta[/code] value, in seconds. Mostly useful when the [Tween] is paused, for controlling it manually. Can also be used to end the [Tween] animation immediately, by using [code]delta[/code] longer than the whole duration.
Returns [code]true[/code] if the [Tween] still has [Tweener]s that haven't finished.
@@ -78,20 +73,13 @@
</description>
</method>
<method name="interpolate_value">
- <return type="Variant">
- </return>
- <argument index="0" name="trans_type" type="Variant">
- </argument>
- <argument index="1" name="ease_type" type="Variant">
- </argument>
- <argument index="2" name="elapsed_time" type="float">
- </argument>
- <argument index="3" name="initial_value" type="float">
- </argument>
- <argument index="4" name="delta_value" type="int" enum="Tween.TransitionType">
- </argument>
- <argument index="5" name="duration" type="int" enum="Tween.EaseType">
- </argument>
+ <return type="Variant" />
+ <argument index="0" name="trans_type" type="Variant" />
+ <argument index="1" name="ease_type" type="Variant" />
+ <argument index="2" name="elapsed_time" type="float" />
+ <argument index="3" name="initial_value" type="float" />
+ <argument index="4" name="delta_value" type="int" enum="Tween.TransitionType" />
+ <argument index="5" name="duration" type="int" enum="Tween.EaseType" />
<description>
This method can be used for manual interpolation of a value, when you don't want [Tween] to do animating for you. It's similar to [method @GlobalScope.lerp], but with support for custom transition and easing.
[code]elapsed_time[/code] is the time in seconds that passed after the interping started and it's used to control the position of the interpolation. E.g. when it's equal to half of the [code]duration[/code], the interpolated value will be halfway between initial and final values. This value can also be greater than [code]duration[/code] or lower than 0, which will extrapolate the value.
@@ -101,29 +89,25 @@
</description>
</method>
<method name="is_running">
- <return type="bool">
- </return>
+ <return type="bool" />
<description>
Returns whether the [Tween] is currently running, i.e. it wasn't paused and it's not finished.
</description>
</method>
<method name="is_valid">
- <return type="bool">
- </return>
+ <return type="bool" />
<description>
Returns whether the [Tween] is valid. A valid [Tween] is a [Tween] contained by the scene tree (i.e. the array from [method SceneTree.get_processed_tweens] will contain this [Tween]). [Tween] might become invalid when it has finished tweening or was killed, also when created with [code]Tween.new()[/code]. Invalid [Tween] can't have [Tweener]s appended, because it can't animate them. You can however still use [method interpolate_value].
</description>
</method>
<method name="kill">
- <return type="void">
- </return>
+ <return type="void" />
<description>
Aborts all tweening operations and invalidates the [Tween].
</description>
</method>
<method name="parallel">
- <return type="Tween">
- </return>
+ <return type="Tween" />
<description>
Makes the next [Tweener] run parallelly to the previous one. Example:
[codeblock]
@@ -137,97 +121,78 @@
</description>
</method>
<method name="pause">
- <return type="void">
- </return>
+ <return type="void" />
<description>
Pauses the tweening. The animation can be resumed by using [method play].
</description>
</method>
<method name="play">
- <return type="void">
- </return>
+ <return type="void" />
<description>
Resumes a paused or stopped [Tween].
</description>
</method>
<method name="set_ease">
- <return type="Tween">
- </return>
- <argument index="0" name="ease" type="int" enum="Tween.EaseType">
- </argument>
+ <return type="Tween" />
+ <argument 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].
</description>
</method>
<method name="set_loops">
- <return type="Tween">
- </return>
- <argument index="0" name="loops" type="int" default="0">
- </argument>
+ <return type="Tween" />
+ <argument index="0" name="loops" type="int" default="0" />
<description>
Sets the number of times the tweening sequence will be repeated, i.e. [code]set_loops(2)[/code] will run the animation twice.
Calling this method without arguments will make the [Tween] run infinitely, until it is either killed by [method kill] or by freeing bound node, or all the animated objects have been freed (which makes further animation impossible).
</description>
</method>
<method name="set_parallel">
- <return type="Tween">
- </return>
- <argument index="0" name="parallel" type="bool" default="true">
- </argument>
+ <return type="Tween" />
+ <argument index="0" name="parallel" type="bool" default="true" />
<description>
If [code]parallel[/code] is [code]true[/code], the [Tweener]s appended after this method will by default run simultaneously, as opposed to sequentially.
</description>
</method>
<method name="set_pause_mode">
- <return type="Tween">
- </return>
- <argument index="0" name="mode" type="int" enum="Tween.TweenPauseMode">
- </argument>
+ <return type="Tween" />
+ <argument index="0" name="mode" type="int" enum="Tween.TweenPauseMode" />
<description>
Determines the behavior of the [Tween] when the [SceneTree] is paused. Check [enum TweenPauseMode] for options.
Default value is [constant TWEEN_PAUSE_BOUND].
</description>
</method>
<method name="set_process_mode">
- <return type="Tween">
- </return>
- <argument index="0" name="mode" type="int" enum="Tween.TweenProcessMode">
- </argument>
+ <return type="Tween" />
+ <argument index="0" name="mode" type="int" enum="Tween.TweenProcessMode" />
<description>
Determines whether the [Tween] should run during idle frame (see [method Node._process]) or physics frame (see [method Node._physics_process].
Default value is [constant TWEEN_PROCESS_IDLE].
</description>
</method>
<method name="set_speed_scale">
- <return type="Tween">
- </return>
- <argument index="0" name="speed" type="float">
- </argument>
+ <return type="Tween" />
+ <argument index="0" name="speed" type="float" />
<description>
Scales the speed of tweening. This affects all [Tweener]s and their delays.
</description>
</method>
<method name="set_trans">
- <return type="Tween">
- </return>
- <argument index="0" name="trans" type="int" enum="Tween.TransitionType">
- </argument>
+ <return type="Tween" />
+ <argument 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].
</description>
</method>
<method name="stop">
- <return type="void">
- </return>
+ <return type="void" />
<description>
Stops the tweening and resets the [Tween] to its initial state. This will not remove any appended [Tweener]s.
</description>
</method>
<method name="tween_callback">
- <return type="CallbackTweener">
- </return>
- <argument index="0" name="callback" type="Callable">
- </argument>
+ <return type="CallbackTweener" />
+ <argument index="0" name="callback" type="Callable" />
<description>
Creates and appends a [CallbackTweener]. This method can be used to call an arbitrary method in any object. Use [method Callable.bind] to bind additional arguments for the call.
Example: object that keeps shooting every 1 second.
@@ -244,10 +209,8 @@
</description>
</method>
<method name="tween_interval">
- <return type="IntervalTweener">
- </return>
- <argument index="0" name="time" type="float">
- </argument>
+ <return type="IntervalTweener" />
+ <argument index="0" name="time" type="float" />
<description>
Creates and appends an [IntervalTweener]. This method can be used to create delays in the tween animation, as an alternative for using the delay in other [Tweener]s or when there's no animation (in which case the [Tween] acts as a timer). [code]time[/code] is the length of the interval, in seconds.
Example: creating an interval in code execution.
@@ -271,16 +234,11 @@
</description>
</method>
<method name="tween_method">
- <return type="MethodTweener">
- </return>
- <argument index="0" name="method" type="Callable">
- </argument>
- <argument index="1" name="from" type="float">
- </argument>
- <argument index="2" name="to" type="float">
- </argument>
- <argument index="3" name="duration" type="float">
- </argument>
+ <return type="MethodTweener" />
+ <argument index="0" name="method" type="Callable" />
+ <argument index="1" name="from" type="float" />
+ <argument index="2" name="to" type="float" />
+ <argument index="3" name="duration" type="float" />
<description>
Creates and appends a [MethodTweener]. This method is similar to a combination of [method tween_callback] and [method tween_property]. It calls a method over time with a tweened value provided as an argument. The value is tweened between [code]from[/code] and [code]to[/code] over the time specified by [code]duration[/code], in seconds. Use [method Callable.bind] to bind additional arguments for the call. You can use [method MethodTweener.set_ease] and [method MethodTweener.set_trans] to tweak the easing and transition of the value or [method MethodTweener.set_delay] to delay the tweening.
Example: making a 3D object look from one point to another point.
@@ -300,16 +258,11 @@
</description>
</method>
<method name="tween_property">
- <return type="PropertyTweener">
- </return>
- <argument index="0" name="object" type="Object">
- </argument>
- <argument index="1" name="property" type="NodePath">
- </argument>
- <argument index="2" name="final_val" type="Variant">
- </argument>
- <argument index="3" name="duration" type="float">
- </argument>
+ <return type="PropertyTweener" />
+ <argument index="0" name="object" type="Object" />
+ <argument index="1" name="property" type="NodePath" />
+ <argument index="2" name="final_val" type="Variant" />
+ <argument index="3" name="duration" type="float" />
<description>
Creates and appends a [PropertyTweener]. This method tweens a [code]property[/code] of an [code]object[/code] between an initial value and [code]final_val[/code] in a span of time equal to [code]duration[/code], in seconds. The initial value by default is a value at the time the tweening of the [PropertyTweener] start. For example:
[codeblock]
@@ -336,15 +289,13 @@
</description>
</signal>
<signal name="loop_finished">
- <argument index="0" name="loop_count" type="int">
- </argument>
+ <argument index="0" name="loop_count" type="int" />
<description>
Emitted when a full loop is complete (see [method set_loops]), providing the loop index. This signal is not emitted after final loop, use [signal finished] instead for this case.
</description>
</signal>
<signal name="step_finished">
- <argument index="0" name="idx" type="int">
- </argument>
+ <argument index="0" name="idx" type="int" />
<description>
Emitted when one step of the [Tween] is complete, providing the step index. One step is either a single [Tweener] or a group of [Tweener]s running parallelly.
</description>