virtualx-engine-docs/_sources/classes/class_tween.rst.txt

683 lines
48 KiB
Text
Raw Normal View History

2024-10-23 18:41:33 +02:00
:github_url: hide
.. DO NOT EDIT THIS FILE!!!
.. Generated automatically from Godot engine sources.
.. Generator: https://github.com/godotengine/godot/tree/3.6/doc/tools/make_rst.py.
.. XML source: https://github.com/godotengine/godot/tree/3.6/doc/classes/Tween.xml.
.. _class_Tween:
Tween
=====
**Inherits:** :ref:`Node<class_Node>` **<** :ref:`Object<class_Object>`
Smoothly animates a node's properties over time.
.. rst-class:: classref-introduction-group
Description
-----------
Tweens are useful for animations requiring a numerical property to be interpolated over a range of values. The name *tween* comes from *in-betweening*, an animation technique where you specify *keyframes* and the computer interpolates the frames that appear between them.
\ **Tween** is more suited than :ref:`AnimationPlayer<class_AnimationPlayer>` for animations where you don't know the final values in advance. For example, interpolating a dynamically-chosen camera zoom value is best done with a **Tween** node; it would be difficult to do the same thing with an :ref:`AnimationPlayer<class_AnimationPlayer>` node.
Here is a brief usage example that makes a 2D node move smoothly between two positions:
::
var tween = get_node("Tween")
tween.interpolate_property($Node2D, "position",
Vector2(0, 0), Vector2(100, 100), 1,
Tween.TRANS_LINEAR, Tween.EASE_IN_OUT)
tween.start()
Many methods require a property name, such as ``"position"`` above. You can find the correct property name by hovering over the property in the Inspector. You can also provide the components of a property directly by using ``"property:component"`` (e.g. ``position:x``), where it would only apply to that particular component.
Many of the methods accept ``trans_type`` and ``ease_type``. The first accepts an :ref:`TransitionType<enum_Tween_TransitionType>` constant, and refers to the way the timing of the animation is handled (see `easings.net <https://easings.net/>`__ for some examples). The second accepts an :ref:`EaseType<enum_Tween_EaseType>` constant, and controls where the ``trans_type`` is applied to the interpolation (in the beginning, the end, or both). If you don't know which transition and easing to pick, you can try different :ref:`TransitionType<enum_Tween_TransitionType>` constants with :ref:`EASE_IN_OUT<class_Tween_constant_EASE_IN_OUT>`, and use the one that looks best.
\ `Tween easing and transition types cheatsheet <https://raw.githubusercontent.com/godotengine/godot-docs/3.6/img/tween_cheatsheet.png>`__\
\ **Note:** Tween methods will return ``false`` if the requested operation cannot be completed.
\ **Note:** For an alternative method of tweening, that doesn't require using nodes, see :ref:`SceneTreeTween<class_SceneTreeTween>`.
.. rst-class:: classref-reftable-group
Properties
----------
.. table::
:widths: auto
+------------------------------------------------------+--------------------------------------------------------------------------+-----------+
| :ref:`TweenProcessMode<enum_Tween_TweenProcessMode>` | :ref:`playback_process_mode<class_Tween_property_playback_process_mode>` | ``1`` |
+------------------------------------------------------+--------------------------------------------------------------------------+-----------+
| :ref:`float<class_float>` | :ref:`playback_speed<class_Tween_property_playback_speed>` | ``1.0`` |
+------------------------------------------------------+--------------------------------------------------------------------------+-----------+
| :ref:`bool<class_bool>` | :ref:`repeat<class_Tween_property_repeat>` | ``false`` |
+------------------------------------------------------+--------------------------------------------------------------------------+-----------+
.. rst-class:: classref-reftable-group
Methods
-------
.. table::
:widths: auto
+---------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`follow_method<class_Tween_method_follow_method>` **(** :ref:`Object<class_Object>` object, :ref:`String<class_String>` method, :ref:`Variant<class_Variant>` initial_val, :ref:`Object<class_Object>` target, :ref:`String<class_String>` target_method, :ref:`float<class_float>` duration, :ref:`TransitionType<enum_Tween_TransitionType>` trans_type=0, :ref:`EaseType<enum_Tween_EaseType>` ease_type=2, :ref:`float<class_float>` delay=0 **)** |
+---------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`follow_property<class_Tween_method_follow_property>` **(** :ref:`Object<class_Object>` object, :ref:`NodePath<class_NodePath>` property, :ref:`Variant<class_Variant>` initial_val, :ref:`Object<class_Object>` target, :ref:`NodePath<class_NodePath>` target_property, :ref:`float<class_float>` duration, :ref:`TransitionType<enum_Tween_TransitionType>` trans_type=0, :ref:`EaseType<enum_Tween_EaseType>` ease_type=2, :ref:`float<class_float>` delay=0 **)** |
+---------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`float<class_float>` | :ref:`get_runtime<class_Tween_method_get_runtime>` **(** **)** |const| |
+---------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`interpolate_callback<class_Tween_method_interpolate_callback>` **(** :ref:`Object<class_Object>` object, :ref:`float<class_float>` duration, :ref:`String<class_String>` callback, :ref:`Variant<class_Variant>` arg1=null, :ref:`Variant<class_Variant>` arg2=null, :ref:`Variant<class_Variant>` arg3=null, :ref:`Variant<class_Variant>` arg4=null, :ref:`Variant<class_Variant>` arg5=null, :ref:`Variant<class_Variant>` arg6=null, :ref:`Variant<class_Variant>` arg7=null, :ref:`Variant<class_Variant>` arg8=null **)** |
+---------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`interpolate_deferred_callback<class_Tween_method_interpolate_deferred_callback>` **(** :ref:`Object<class_Object>` object, :ref:`float<class_float>` duration, :ref:`String<class_String>` callback, :ref:`Variant<class_Variant>` arg1=null, :ref:`Variant<class_Variant>` arg2=null, :ref:`Variant<class_Variant>` arg3=null, :ref:`Variant<class_Variant>` arg4=null, :ref:`Variant<class_Variant>` arg5=null, :ref:`Variant<class_Variant>` arg6=null, :ref:`Variant<class_Variant>` arg7=null, :ref:`Variant<class_Variant>` arg8=null **)** |
+---------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`interpolate_method<class_Tween_method_interpolate_method>` **(** :ref:`Object<class_Object>` object, :ref:`String<class_String>` method, :ref:`Variant<class_Variant>` initial_val, :ref:`Variant<class_Variant>` final_val, :ref:`float<class_float>` duration, :ref:`TransitionType<enum_Tween_TransitionType>` trans_type=0, :ref:`EaseType<enum_Tween_EaseType>` ease_type=2, :ref:`float<class_float>` delay=0 **)** |
+---------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`interpolate_property<class_Tween_method_interpolate_property>` **(** :ref:`Object<class_Object>` object, :ref:`NodePath<class_NodePath>` property, :ref:`Variant<class_Variant>` initial_val, :ref:`Variant<class_Variant>` final_val, :ref:`float<class_float>` duration, :ref:`TransitionType<enum_Tween_TransitionType>` trans_type=0, :ref:`EaseType<enum_Tween_EaseType>` ease_type=2, :ref:`float<class_float>` delay=0 **)** |
+---------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`is_active<class_Tween_method_is_active>` **(** **)** |const| |
+---------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`remove<class_Tween_method_remove>` **(** :ref:`Object<class_Object>` object, :ref:`String<class_String>` key="" **)** |
+---------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`remove_all<class_Tween_method_remove_all>` **(** **)** |
+---------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`reset<class_Tween_method_reset>` **(** :ref:`Object<class_Object>` object, :ref:`String<class_String>` key="" **)** |
+---------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`reset_all<class_Tween_method_reset_all>` **(** **)** |
+---------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`resume<class_Tween_method_resume>` **(** :ref:`Object<class_Object>` object, :ref:`String<class_String>` key="" **)** |
+---------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`resume_all<class_Tween_method_resume_all>` **(** **)** |
+---------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`seek<class_Tween_method_seek>` **(** :ref:`float<class_float>` time **)** |
+---------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`set_active<class_Tween_method_set_active>` **(** :ref:`bool<class_bool>` active **)** |
+---------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`start<class_Tween_method_start>` **(** **)** |
+---------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`stop<class_Tween_method_stop>` **(** :ref:`Object<class_Object>` object, :ref:`String<class_String>` key="" **)** |
+---------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`stop_all<class_Tween_method_stop_all>` **(** **)** |
+---------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`targeting_method<class_Tween_method_targeting_method>` **(** :ref:`Object<class_Object>` object, :ref:`String<class_String>` method, :ref:`Object<class_Object>` initial, :ref:`String<class_String>` initial_method, :ref:`Variant<class_Variant>` final_val, :ref:`float<class_float>` duration, :ref:`TransitionType<enum_Tween_TransitionType>` trans_type=0, :ref:`EaseType<enum_Tween_EaseType>` ease_type=2, :ref:`float<class_float>` delay=0 **)** |
+---------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`targeting_property<class_Tween_method_targeting_property>` **(** :ref:`Object<class_Object>` object, :ref:`NodePath<class_NodePath>` property, :ref:`Object<class_Object>` initial, :ref:`NodePath<class_NodePath>` initial_val, :ref:`Variant<class_Variant>` final_val, :ref:`float<class_float>` duration, :ref:`TransitionType<enum_Tween_TransitionType>` trans_type=0, :ref:`EaseType<enum_Tween_EaseType>` ease_type=2, :ref:`float<class_float>` delay=0 **)** |
+---------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`float<class_float>` | :ref:`tell<class_Tween_method_tell>` **(** **)** |const| |
+---------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
.. rst-class:: classref-section-separator
----
.. rst-class:: classref-descriptions-group
Signals
-------
.. _class_Tween_signal_tween_all_completed:
.. rst-class:: classref-signal
**tween_all_completed** **(** **)**
Emitted when all processes in a tween end.
.. rst-class:: classref-item-separator
----
.. _class_Tween_signal_tween_completed:
.. rst-class:: classref-signal
**tween_completed** **(** :ref:`Object<class_Object>` object, :ref:`NodePath<class_NodePath>` key **)**
Emitted when a tween ends.
.. rst-class:: classref-item-separator
----
.. _class_Tween_signal_tween_started:
.. rst-class:: classref-signal
**tween_started** **(** :ref:`Object<class_Object>` object, :ref:`NodePath<class_NodePath>` key **)**
Emitted when a tween starts.
.. rst-class:: classref-item-separator
----
.. _class_Tween_signal_tween_step:
.. rst-class:: classref-signal
**tween_step** **(** :ref:`Object<class_Object>` object, :ref:`NodePath<class_NodePath>` key, :ref:`float<class_float>` elapsed, :ref:`Object<class_Object>` value **)**
Emitted at each step of the animation.
.. rst-class:: classref-section-separator
----
.. rst-class:: classref-descriptions-group
Enumerations
------------
.. _enum_Tween_TweenProcessMode:
.. rst-class:: classref-enumeration
enum **TweenProcessMode**:
.. _class_Tween_constant_TWEEN_PROCESS_PHYSICS:
.. rst-class:: classref-enumeration-constant
:ref:`TweenProcessMode<enum_Tween_TweenProcessMode>` **TWEEN_PROCESS_PHYSICS** = ``0``
The tween updates with the ``_physics_process`` callback.
.. _class_Tween_constant_TWEEN_PROCESS_IDLE:
.. rst-class:: classref-enumeration-constant
:ref:`TweenProcessMode<enum_Tween_TweenProcessMode>` **TWEEN_PROCESS_IDLE** = ``1``
The tween updates with the ``_process`` callback.
.. rst-class:: classref-item-separator
----
.. _enum_Tween_TransitionType:
.. rst-class:: classref-enumeration
enum **TransitionType**:
.. _class_Tween_constant_TRANS_LINEAR:
.. rst-class:: classref-enumeration-constant
:ref:`TransitionType<enum_Tween_TransitionType>` **TRANS_LINEAR** = ``0``
The animation is interpolated linearly.
.. _class_Tween_constant_TRANS_SINE:
.. rst-class:: classref-enumeration-constant
:ref:`TransitionType<enum_Tween_TransitionType>` **TRANS_SINE** = ``1``
The animation is interpolated using a sine function.
.. _class_Tween_constant_TRANS_QUINT:
.. rst-class:: classref-enumeration-constant
:ref:`TransitionType<enum_Tween_TransitionType>` **TRANS_QUINT** = ``2``
The animation is interpolated with a quintic (to the power of 5) function.
.. _class_Tween_constant_TRANS_QUART:
.. rst-class:: classref-enumeration-constant
:ref:`TransitionType<enum_Tween_TransitionType>` **TRANS_QUART** = ``3``
The animation is interpolated with a quartic (to the power of 4) function.
.. _class_Tween_constant_TRANS_QUAD:
.. rst-class:: classref-enumeration-constant
:ref:`TransitionType<enum_Tween_TransitionType>` **TRANS_QUAD** = ``4``
The animation is interpolated with a quadratic (to the power of 2) function.
.. _class_Tween_constant_TRANS_EXPO:
.. rst-class:: classref-enumeration-constant
:ref:`TransitionType<enum_Tween_TransitionType>` **TRANS_EXPO** = ``5``
The animation is interpolated with an exponential (to the power of x) function.
.. _class_Tween_constant_TRANS_ELASTIC:
.. rst-class:: classref-enumeration-constant
:ref:`TransitionType<enum_Tween_TransitionType>` **TRANS_ELASTIC** = ``6``
The animation is interpolated with elasticity, wiggling around the edges.
.. _class_Tween_constant_TRANS_CUBIC:
.. rst-class:: classref-enumeration-constant
:ref:`TransitionType<enum_Tween_TransitionType>` **TRANS_CUBIC** = ``7``
The animation is interpolated with a cubic (to the power of 3) function.
.. _class_Tween_constant_TRANS_CIRC:
.. rst-class:: classref-enumeration-constant
:ref:`TransitionType<enum_Tween_TransitionType>` **TRANS_CIRC** = ``8``
The animation is interpolated with a function using square roots.
.. _class_Tween_constant_TRANS_BOUNCE:
.. rst-class:: classref-enumeration-constant
:ref:`TransitionType<enum_Tween_TransitionType>` **TRANS_BOUNCE** = ``9``
The animation is interpolated by bouncing at the end.
.. _class_Tween_constant_TRANS_BACK:
.. rst-class:: classref-enumeration-constant
:ref:`TransitionType<enum_Tween_TransitionType>` **TRANS_BACK** = ``10``
The animation is interpolated backing out at ends.
.. rst-class:: classref-item-separator
----
.. _enum_Tween_EaseType:
.. rst-class:: classref-enumeration
enum **EaseType**:
.. _class_Tween_constant_EASE_IN:
.. rst-class:: classref-enumeration-constant
:ref:`EaseType<enum_Tween_EaseType>` **EASE_IN** = ``0``
The interpolation starts slowly and speeds up towards the end.
.. _class_Tween_constant_EASE_OUT:
.. rst-class:: classref-enumeration-constant
:ref:`EaseType<enum_Tween_EaseType>` **EASE_OUT** = ``1``
The interpolation starts quickly and slows down towards the end.
.. _class_Tween_constant_EASE_IN_OUT:
.. rst-class:: classref-enumeration-constant
:ref:`EaseType<enum_Tween_EaseType>` **EASE_IN_OUT** = ``2``
A combination of :ref:`EASE_IN<class_Tween_constant_EASE_IN>` and :ref:`EASE_OUT<class_Tween_constant_EASE_OUT>`. The interpolation is slowest at both ends.
.. _class_Tween_constant_EASE_OUT_IN:
.. rst-class:: classref-enumeration-constant
:ref:`EaseType<enum_Tween_EaseType>` **EASE_OUT_IN** = ``3``
A combination of :ref:`EASE_IN<class_Tween_constant_EASE_IN>` and :ref:`EASE_OUT<class_Tween_constant_EASE_OUT>`. The interpolation is fastest at both ends.
.. rst-class:: classref-section-separator
----
.. rst-class:: classref-descriptions-group
Property Descriptions
---------------------
.. _class_Tween_property_playback_process_mode:
.. rst-class:: classref-property
:ref:`TweenProcessMode<enum_Tween_TweenProcessMode>` **playback_process_mode** = ``1``
.. rst-class:: classref-property-setget
- void **set_tween_process_mode** **(** :ref:`TweenProcessMode<enum_Tween_TweenProcessMode>` value **)**
- :ref:`TweenProcessMode<enum_Tween_TweenProcessMode>` **get_tween_process_mode** **(** **)**
The tween's animation process thread. See :ref:`TweenProcessMode<enum_Tween_TweenProcessMode>`.
.. rst-class:: classref-item-separator
----
.. _class_Tween_property_playback_speed:
.. rst-class:: classref-property
:ref:`float<class_float>` **playback_speed** = ``1.0``
.. rst-class:: classref-property-setget
- void **set_speed_scale** **(** :ref:`float<class_float>` value **)**
- :ref:`float<class_float>` **get_speed_scale** **(** **)**
The tween's speed multiplier. For example, set it to ``1.0`` for normal speed, ``2.0`` for two times normal speed, or ``0.5`` for half of the normal speed. A value of ``0`` pauses the animation, but see also :ref:`set_active<class_Tween_method_set_active>` or :ref:`stop_all<class_Tween_method_stop_all>` for this.
.. rst-class:: classref-item-separator
----
.. _class_Tween_property_repeat:
.. rst-class:: classref-property
:ref:`bool<class_bool>` **repeat** = ``false``
.. rst-class:: classref-property-setget
- void **set_repeat** **(** :ref:`bool<class_bool>` value **)**
- :ref:`bool<class_bool>` **is_repeat** **(** **)**
If ``true``, the tween loops.
.. rst-class:: classref-section-separator
----
.. rst-class:: classref-descriptions-group
Method Descriptions
-------------------
.. _class_Tween_method_follow_method:
.. rst-class:: classref-method
:ref:`bool<class_bool>` **follow_method** **(** :ref:`Object<class_Object>` object, :ref:`String<class_String>` method, :ref:`Variant<class_Variant>` initial_val, :ref:`Object<class_Object>` target, :ref:`String<class_String>` target_method, :ref:`float<class_float>` duration, :ref:`TransitionType<enum_Tween_TransitionType>` trans_type=0, :ref:`EaseType<enum_Tween_EaseType>` ease_type=2, :ref:`float<class_float>` delay=0 **)**
Follows ``method`` of ``object`` and applies the returned value on ``target_method`` of ``target``, beginning from ``initial_val`` for ``duration`` seconds, ``delay`` later. Methods are called with consecutive values.
Use :ref:`TransitionType<enum_Tween_TransitionType>` for ``trans_type`` and :ref:`EaseType<enum_Tween_EaseType>` for ``ease_type`` parameters. These values control the timing and direction of the interpolation. See the class description for more information.
.. rst-class:: classref-item-separator
----
.. _class_Tween_method_follow_property:
.. rst-class:: classref-method
:ref:`bool<class_bool>` **follow_property** **(** :ref:`Object<class_Object>` object, :ref:`NodePath<class_NodePath>` property, :ref:`Variant<class_Variant>` initial_val, :ref:`Object<class_Object>` target, :ref:`NodePath<class_NodePath>` target_property, :ref:`float<class_float>` duration, :ref:`TransitionType<enum_Tween_TransitionType>` trans_type=0, :ref:`EaseType<enum_Tween_EaseType>` ease_type=2, :ref:`float<class_float>` delay=0 **)**
Follows ``property`` of ``object`` and applies it on ``target_property`` of ``target``, beginning from ``initial_val`` for ``duration`` seconds, ``delay`` seconds later.
Use :ref:`TransitionType<enum_Tween_TransitionType>` for ``trans_type`` and :ref:`EaseType<enum_Tween_EaseType>` for ``ease_type`` parameters. These values control the timing and direction of the interpolation. See the class description for more information.
.. rst-class:: classref-item-separator
----
.. _class_Tween_method_get_runtime:
.. rst-class:: classref-method
:ref:`float<class_float>` **get_runtime** **(** **)** |const|
Returns the total time needed for all tweens to end. If you have two tweens, one lasting 10 seconds and the other 20 seconds, it would return 20 seconds, as by that time all tweens would have finished.
.. rst-class:: classref-item-separator
----
.. _class_Tween_method_interpolate_callback:
.. rst-class:: classref-method
:ref:`bool<class_bool>` **interpolate_callback** **(** :ref:`Object<class_Object>` object, :ref:`float<class_float>` duration, :ref:`String<class_String>` callback, :ref:`Variant<class_Variant>` arg1=null, :ref:`Variant<class_Variant>` arg2=null, :ref:`Variant<class_Variant>` arg3=null, :ref:`Variant<class_Variant>` arg4=null, :ref:`Variant<class_Variant>` arg5=null, :ref:`Variant<class_Variant>` arg6=null, :ref:`Variant<class_Variant>` arg7=null, :ref:`Variant<class_Variant>` arg8=null **)**
Calls ``callback`` of ``object`` after ``duration``. ``arg1``-``arg5`` are arguments to be passed to the callback.
.. rst-class:: classref-item-separator
----
.. _class_Tween_method_interpolate_deferred_callback:
.. rst-class:: classref-method
:ref:`bool<class_bool>` **interpolate_deferred_callback** **(** :ref:`Object<class_Object>` object, :ref:`float<class_float>` duration, :ref:`String<class_String>` callback, :ref:`Variant<class_Variant>` arg1=null, :ref:`Variant<class_Variant>` arg2=null, :ref:`Variant<class_Variant>` arg3=null, :ref:`Variant<class_Variant>` arg4=null, :ref:`Variant<class_Variant>` arg5=null, :ref:`Variant<class_Variant>` arg6=null, :ref:`Variant<class_Variant>` arg7=null, :ref:`Variant<class_Variant>` arg8=null **)**
Calls ``callback`` of ``object`` after ``duration`` on the main thread (similar to :ref:`Object.call_deferred<class_Object_method_call_deferred>`). ``arg1``-``arg5`` are arguments to be passed to the callback.
.. rst-class:: classref-item-separator
----
.. _class_Tween_method_interpolate_method:
.. rst-class:: classref-method
:ref:`bool<class_bool>` **interpolate_method** **(** :ref:`Object<class_Object>` object, :ref:`String<class_String>` method, :ref:`Variant<class_Variant>` initial_val, :ref:`Variant<class_Variant>` final_val, :ref:`float<class_float>` duration, :ref:`TransitionType<enum_Tween_TransitionType>` trans_type=0, :ref:`EaseType<enum_Tween_EaseType>` ease_type=2, :ref:`float<class_float>` delay=0 **)**
Animates ``method`` of ``object`` from ``initial_val`` to ``final_val`` for ``duration`` seconds, ``delay`` seconds later. Methods are called with consecutive values.
Use :ref:`TransitionType<enum_Tween_TransitionType>` for ``trans_type`` and :ref:`EaseType<enum_Tween_EaseType>` for ``ease_type`` parameters. These values control the timing and direction of the interpolation. See the class description for more information.
.. rst-class:: classref-item-separator
----
.. _class_Tween_method_interpolate_property:
.. rst-class:: classref-method
:ref:`bool<class_bool>` **interpolate_property** **(** :ref:`Object<class_Object>` object, :ref:`NodePath<class_NodePath>` property, :ref:`Variant<class_Variant>` initial_val, :ref:`Variant<class_Variant>` final_val, :ref:`float<class_float>` duration, :ref:`TransitionType<enum_Tween_TransitionType>` trans_type=0, :ref:`EaseType<enum_Tween_EaseType>` ease_type=2, :ref:`float<class_float>` delay=0 **)**
Animates ``property`` of ``object`` from ``initial_val`` to ``final_val`` for ``duration`` seconds, ``delay`` seconds later. Setting the initial value to ``null`` uses the current value of the property.
Use :ref:`TransitionType<enum_Tween_TransitionType>` for ``trans_type`` and :ref:`EaseType<enum_Tween_EaseType>` for ``ease_type`` parameters. These values control the timing and direction of the interpolation. See the class description for more information.
.. rst-class:: classref-item-separator
----
.. _class_Tween_method_is_active:
.. rst-class:: classref-method
:ref:`bool<class_bool>` **is_active** **(** **)** |const|
Returns ``true`` if any tweens are currently running.
\ **Note:** This method doesn't consider tweens that have ended.
.. rst-class:: classref-item-separator
----
.. _class_Tween_method_remove:
.. rst-class:: classref-method
:ref:`bool<class_bool>` **remove** **(** :ref:`Object<class_Object>` object, :ref:`String<class_String>` key="" **)**
Stops animation and removes a tween, given its object and property/method pair. By default, all tweens are removed, unless ``key`` is specified.
.. rst-class:: classref-item-separator
----
.. _class_Tween_method_remove_all:
.. rst-class:: classref-method
:ref:`bool<class_bool>` **remove_all** **(** **)**
Stops animation and removes all tweens.
.. rst-class:: classref-item-separator
----
.. _class_Tween_method_reset:
.. rst-class:: classref-method
:ref:`bool<class_bool>` **reset** **(** :ref:`Object<class_Object>` object, :ref:`String<class_String>` key="" **)**
Resets a tween to its initial value (the one given, not the one before the tween), given its object and property/method pair. By default, all tweens are reset, unless ``key`` is specified.
.. rst-class:: classref-item-separator
----
.. _class_Tween_method_reset_all:
.. rst-class:: classref-method
:ref:`bool<class_bool>` **reset_all** **(** **)**
Resets all tweens to their initial values (the ones given, not those before the tween).
.. rst-class:: classref-item-separator
----
.. _class_Tween_method_resume:
.. rst-class:: classref-method
:ref:`bool<class_bool>` **resume** **(** :ref:`Object<class_Object>` object, :ref:`String<class_String>` key="" **)**
Continues animating a stopped tween, given its object and property/method pair. By default, all tweens are resumed, unless ``key`` is specified.
.. rst-class:: classref-item-separator
----
.. _class_Tween_method_resume_all:
.. rst-class:: classref-method
:ref:`bool<class_bool>` **resume_all** **(** **)**
Continues animating all stopped tweens.
.. rst-class:: classref-item-separator
----
.. _class_Tween_method_seek:
.. rst-class:: classref-method
:ref:`bool<class_bool>` **seek** **(** :ref:`float<class_float>` time **)**
Sets the interpolation to the given ``time`` in seconds.
.. rst-class:: classref-item-separator
----
.. _class_Tween_method_set_active:
.. rst-class:: classref-method
void **set_active** **(** :ref:`bool<class_bool>` active **)**
Activates/deactivates the tween. See also :ref:`stop_all<class_Tween_method_stop_all>` and :ref:`resume_all<class_Tween_method_resume_all>`.
.. rst-class:: classref-item-separator
----
.. _class_Tween_method_start:
.. rst-class:: classref-method
:ref:`bool<class_bool>` **start** **(** **)**
Starts the tween. You can define animations both before and after this.
.. rst-class:: classref-item-separator
----
.. _class_Tween_method_stop:
.. rst-class:: classref-method
:ref:`bool<class_bool>` **stop** **(** :ref:`Object<class_Object>` object, :ref:`String<class_String>` key="" **)**
Stops a tween, given its object and property/method pair. By default, all tweens are stopped, unless ``key`` is specified.
.. rst-class:: classref-item-separator
----
.. _class_Tween_method_stop_all:
.. rst-class:: classref-method
:ref:`bool<class_bool>` **stop_all** **(** **)**
Stops animating all tweens.
.. rst-class:: classref-item-separator
----
.. _class_Tween_method_targeting_method:
.. rst-class:: classref-method
:ref:`bool<class_bool>` **targeting_method** **(** :ref:`Object<class_Object>` object, :ref:`String<class_String>` method, :ref:`Object<class_Object>` initial, :ref:`String<class_String>` initial_method, :ref:`Variant<class_Variant>` final_val, :ref:`float<class_float>` duration, :ref:`TransitionType<enum_Tween_TransitionType>` trans_type=0, :ref:`EaseType<enum_Tween_EaseType>` ease_type=2, :ref:`float<class_float>` delay=0 **)**
Animates ``method`` of ``object`` from the value returned by ``initial_method`` to ``final_val`` for ``duration`` seconds, ``delay`` seconds later. Methods are animated by calling them with consecutive values.
Use :ref:`TransitionType<enum_Tween_TransitionType>` for ``trans_type`` and :ref:`EaseType<enum_Tween_EaseType>` for ``ease_type`` parameters. These values control the timing and direction of the interpolation. See the class description for more information.
.. rst-class:: classref-item-separator
----
.. _class_Tween_method_targeting_property:
.. rst-class:: classref-method
:ref:`bool<class_bool>` **targeting_property** **(** :ref:`Object<class_Object>` object, :ref:`NodePath<class_NodePath>` property, :ref:`Object<class_Object>` initial, :ref:`NodePath<class_NodePath>` initial_val, :ref:`Variant<class_Variant>` final_val, :ref:`float<class_float>` duration, :ref:`TransitionType<enum_Tween_TransitionType>` trans_type=0, :ref:`EaseType<enum_Tween_EaseType>` ease_type=2, :ref:`float<class_float>` delay=0 **)**
Animates ``property`` of ``object`` from the current value of the ``initial_val`` property of ``initial`` to ``final_val`` for ``duration`` seconds, ``delay`` seconds later.
Use :ref:`TransitionType<enum_Tween_TransitionType>` for ``trans_type`` and :ref:`EaseType<enum_Tween_EaseType>` for ``ease_type`` parameters. These values control the timing and direction of the interpolation. See the class description for more information.
.. rst-class:: classref-item-separator
----
.. _class_Tween_method_tell:
.. rst-class:: classref-method
:ref:`float<class_float>` **tell** **(** **)** |const|
Returns the current time of the tween.
.. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
.. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
.. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`