mirror of
https://github.com/godotengine/godot-docs-l10n.git
synced 2025-12-31 09:49:22 +03:00
929 lines
72 KiB
ReStructuredText
929 lines
72 KiB
ReStructuredText
:github_url: hide
|
|
|
|
.. _class_AnimationPlayer:
|
|
|
|
AnimationPlayer
|
|
===============
|
|
|
|
**Hereda:** :ref:`AnimationMixer<class_AnimationMixer>` **<** :ref:`Node<class_Node>` **<** :ref:`Object<class_Object>`
|
|
|
|
Un nodo utilizado para la reproducción de animación.
|
|
|
|
.. rst-class:: classref-introduction-group
|
|
|
|
Descripción
|
|
----------------------
|
|
|
|
An animation player is used for general-purpose playback of animations. It contains a dictionary of :ref:`AnimationLibrary<class_AnimationLibrary>` resources and custom blend times between animation transitions.
|
|
|
|
Some methods and properties use a single key to reference an animation directly. These keys are formatted as the key for the library, followed by a forward slash, then the key for the animation within the library, for example ``"movement/run"``. If the library's key is an empty string (known as the default library), the forward slash is omitted, being the same key used by the library.
|
|
|
|
\ **AnimationPlayer** is better-suited than :ref:`Tween<class_Tween>` for more complex animations, for example ones with non-trivial timings. It can also be used over :ref:`Tween<class_Tween>` if the animation track editor is more convenient than doing it in code.
|
|
|
|
Updating the target properties of animations occurs at the process frame.
|
|
|
|
.. rst-class:: classref-introduction-group
|
|
|
|
Tutoriales
|
|
--------------------
|
|
|
|
- :doc:`Animación de Sprite 2D <../tutorials/2d/2d_sprite_animation>`
|
|
|
|
- :doc:`Índice de documentación de animación <../tutorials/animation/index>`
|
|
|
|
- `Demo de Shooter en Tercera Persona (TPS) <https://godotengine.org/asset-library/asset/2710>`__
|
|
|
|
.. rst-class:: classref-reftable-group
|
|
|
|
Propiedades
|
|
----------------------
|
|
|
|
.. table::
|
|
:widths: auto
|
|
|
|
+--------------------------------------------------+--------------------------------------------------------------------------------------------------------------------+-----------+
|
|
| :ref:`StringName<class_StringName>` | :ref:`assigned_animation<class_AnimationPlayer_property_assigned_animation>` | |
|
|
+--------------------------------------------------+--------------------------------------------------------------------------------------------------------------------+-----------+
|
|
| :ref:`StringName<class_StringName>` | :ref:`autoplay<class_AnimationPlayer_property_autoplay>` | ``&""`` |
|
|
+--------------------------------------------------+--------------------------------------------------------------------------------------------------------------------+-----------+
|
|
| :ref:`StringName<class_StringName>` | :ref:`current_animation<class_AnimationPlayer_property_current_animation>` | ``&""`` |
|
|
+--------------------------------------------------+--------------------------------------------------------------------------------------------------------------------+-----------+
|
|
| :ref:`float<class_float>` | :ref:`current_animation_length<class_AnimationPlayer_property_current_animation_length>` | |
|
|
+--------------------------------------------------+--------------------------------------------------------------------------------------------------------------------+-----------+
|
|
| :ref:`float<class_float>` | :ref:`current_animation_position<class_AnimationPlayer_property_current_animation_position>` | |
|
|
+--------------------------------------------------+--------------------------------------------------------------------------------------------------------------------+-----------+
|
|
| :ref:`bool<class_bool>` | :ref:`movie_quit_on_finish<class_AnimationPlayer_property_movie_quit_on_finish>` | ``false`` |
|
|
+--------------------------------------------------+--------------------------------------------------------------------------------------------------------------------+-----------+
|
|
| :ref:`bool<class_bool>` | :ref:`playback_auto_capture<class_AnimationPlayer_property_playback_auto_capture>` | ``true`` |
|
|
+--------------------------------------------------+--------------------------------------------------------------------------------------------------------------------+-----------+
|
|
| :ref:`float<class_float>` | :ref:`playback_auto_capture_duration<class_AnimationPlayer_property_playback_auto_capture_duration>` | ``-1.0`` |
|
|
+--------------------------------------------------+--------------------------------------------------------------------------------------------------------------------+-----------+
|
|
| :ref:`EaseType<enum_Tween_EaseType>` | :ref:`playback_auto_capture_ease_type<class_AnimationPlayer_property_playback_auto_capture_ease_type>` | ``0`` |
|
|
+--------------------------------------------------+--------------------------------------------------------------------------------------------------------------------+-----------+
|
|
| :ref:`TransitionType<enum_Tween_TransitionType>` | :ref:`playback_auto_capture_transition_type<class_AnimationPlayer_property_playback_auto_capture_transition_type>` | ``0`` |
|
|
+--------------------------------------------------+--------------------------------------------------------------------------------------------------------------------+-----------+
|
|
| :ref:`float<class_float>` | :ref:`playback_default_blend_time<class_AnimationPlayer_property_playback_default_blend_time>` | ``0.0`` |
|
|
+--------------------------------------------------+--------------------------------------------------------------------------------------------------------------------+-----------+
|
|
| :ref:`float<class_float>` | :ref:`speed_scale<class_AnimationPlayer_property_speed_scale>` | ``1.0`` |
|
|
+--------------------------------------------------+--------------------------------------------------------------------------------------------------------------------+-----------+
|
|
|
|
.. rst-class:: classref-reftable-group
|
|
|
|
Métodos
|
|
--------------
|
|
|
|
.. table::
|
|
:widths: auto
|
|
|
|
+--------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`StringName<class_StringName>` | :ref:`animation_get_next<class_AnimationPlayer_method_animation_get_next>`\ (\ animation_from\: :ref:`StringName<class_StringName>`\ ) |const| |
|
|
+--------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| |void| | :ref:`animation_set_next<class_AnimationPlayer_method_animation_set_next>`\ (\ animation_from\: :ref:`StringName<class_StringName>`, animation_to\: :ref:`StringName<class_StringName>`\ ) |
|
|
+--------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| |void| | :ref:`clear_queue<class_AnimationPlayer_method_clear_queue>`\ (\ ) |
|
|
+--------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`float<class_float>` | :ref:`get_blend_time<class_AnimationPlayer_method_get_blend_time>`\ (\ animation_from\: :ref:`StringName<class_StringName>`, animation_to\: :ref:`StringName<class_StringName>`\ ) |const| |
|
|
+--------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`AnimationMethodCallMode<enum_AnimationPlayer_AnimationMethodCallMode>` | :ref:`get_method_call_mode<class_AnimationPlayer_method_get_method_call_mode>`\ (\ ) |const| |
|
|
+--------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`float<class_float>` | :ref:`get_playing_speed<class_AnimationPlayer_method_get_playing_speed>`\ (\ ) |const| |
|
|
+--------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`AnimationProcessCallback<enum_AnimationPlayer_AnimationProcessCallback>` | :ref:`get_process_callback<class_AnimationPlayer_method_get_process_callback>`\ (\ ) |const| |
|
|
+--------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`Array<class_Array>`\[:ref:`StringName<class_StringName>`\] | :ref:`get_queue<class_AnimationPlayer_method_get_queue>`\ (\ ) |
|
|
+--------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`NodePath<class_NodePath>` | :ref:`get_root<class_AnimationPlayer_method_get_root>`\ (\ ) |const| |
|
|
+--------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`float<class_float>` | :ref:`get_section_end_time<class_AnimationPlayer_method_get_section_end_time>`\ (\ ) |const| |
|
|
+--------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`float<class_float>` | :ref:`get_section_start_time<class_AnimationPlayer_method_get_section_start_time>`\ (\ ) |const| |
|
|
+--------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`bool<class_bool>` | :ref:`has_section<class_AnimationPlayer_method_has_section>`\ (\ ) |const| |
|
|
+--------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`bool<class_bool>` | :ref:`is_animation_active<class_AnimationPlayer_method_is_animation_active>`\ (\ ) |const| |
|
|
+--------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`bool<class_bool>` | :ref:`is_playing<class_AnimationPlayer_method_is_playing>`\ (\ ) |const| |
|
|
+--------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| |void| | :ref:`pause<class_AnimationPlayer_method_pause>`\ (\ ) |
|
|
+--------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| |void| | :ref:`play<class_AnimationPlayer_method_play>`\ (\ name\: :ref:`StringName<class_StringName>` = &"", custom_blend\: :ref:`float<class_float>` = -1, custom_speed\: :ref:`float<class_float>` = 1.0, from_end\: :ref:`bool<class_bool>` = false\ ) |
|
|
+--------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| |void| | :ref:`play_backwards<class_AnimationPlayer_method_play_backwards>`\ (\ name\: :ref:`StringName<class_StringName>` = &"", custom_blend\: :ref:`float<class_float>` = -1\ ) |
|
|
+--------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| |void| | :ref:`play_section<class_AnimationPlayer_method_play_section>`\ (\ name\: :ref:`StringName<class_StringName>` = &"", start_time\: :ref:`float<class_float>` = -1, end_time\: :ref:`float<class_float>` = -1, custom_blend\: :ref:`float<class_float>` = -1, custom_speed\: :ref:`float<class_float>` = 1.0, from_end\: :ref:`bool<class_bool>` = false\ ) |
|
|
+--------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| |void| | :ref:`play_section_backwards<class_AnimationPlayer_method_play_section_backwards>`\ (\ name\: :ref:`StringName<class_StringName>` = &"", start_time\: :ref:`float<class_float>` = -1, end_time\: :ref:`float<class_float>` = -1, custom_blend\: :ref:`float<class_float>` = -1\ ) |
|
|
+--------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| |void| | :ref:`play_section_with_markers<class_AnimationPlayer_method_play_section_with_markers>`\ (\ name\: :ref:`StringName<class_StringName>` = &"", start_marker\: :ref:`StringName<class_StringName>` = &"", end_marker\: :ref:`StringName<class_StringName>` = &"", custom_blend\: :ref:`float<class_float>` = -1, custom_speed\: :ref:`float<class_float>` = 1.0, from_end\: :ref:`bool<class_bool>` = false\ ) |
|
|
+--------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| |void| | :ref:`play_section_with_markers_backwards<class_AnimationPlayer_method_play_section_with_markers_backwards>`\ (\ name\: :ref:`StringName<class_StringName>` = &"", start_marker\: :ref:`StringName<class_StringName>` = &"", end_marker\: :ref:`StringName<class_StringName>` = &"", custom_blend\: :ref:`float<class_float>` = -1\ ) |
|
|
+--------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| |void| | :ref:`play_with_capture<class_AnimationPlayer_method_play_with_capture>`\ (\ name\: :ref:`StringName<class_StringName>` = &"", duration\: :ref:`float<class_float>` = -1.0, custom_blend\: :ref:`float<class_float>` = -1, custom_speed\: :ref:`float<class_float>` = 1.0, from_end\: :ref:`bool<class_bool>` = false, trans_type\: :ref:`TransitionType<enum_Tween_TransitionType>` = 0, ease_type\: :ref:`EaseType<enum_Tween_EaseType>` = 0\ ) |
|
|
+--------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| |void| | :ref:`queue<class_AnimationPlayer_method_queue>`\ (\ name\: :ref:`StringName<class_StringName>`\ ) |
|
|
+--------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| |void| | :ref:`reset_section<class_AnimationPlayer_method_reset_section>`\ (\ ) |
|
|
+--------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| |void| | :ref:`seek<class_AnimationPlayer_method_seek>`\ (\ seconds\: :ref:`float<class_float>`, update\: :ref:`bool<class_bool>` = false, update_only\: :ref:`bool<class_bool>` = false\ ) |
|
|
+--------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| |void| | :ref:`set_blend_time<class_AnimationPlayer_method_set_blend_time>`\ (\ animation_from\: :ref:`StringName<class_StringName>`, animation_to\: :ref:`StringName<class_StringName>`, sec\: :ref:`float<class_float>`\ ) |
|
|
+--------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| |void| | :ref:`set_method_call_mode<class_AnimationPlayer_method_set_method_call_mode>`\ (\ mode\: :ref:`AnimationMethodCallMode<enum_AnimationPlayer_AnimationMethodCallMode>`\ ) |
|
|
+--------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| |void| | :ref:`set_process_callback<class_AnimationPlayer_method_set_process_callback>`\ (\ mode\: :ref:`AnimationProcessCallback<enum_AnimationPlayer_AnimationProcessCallback>`\ ) |
|
|
+--------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| |void| | :ref:`set_root<class_AnimationPlayer_method_set_root>`\ (\ path\: :ref:`NodePath<class_NodePath>`\ ) |
|
|
+--------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| |void| | :ref:`set_section<class_AnimationPlayer_method_set_section>`\ (\ start_time\: :ref:`float<class_float>` = -1, end_time\: :ref:`float<class_float>` = -1\ ) |
|
|
+--------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| |void| | :ref:`set_section_with_markers<class_AnimationPlayer_method_set_section_with_markers>`\ (\ start_marker\: :ref:`StringName<class_StringName>` = &"", end_marker\: :ref:`StringName<class_StringName>` = &""\ ) |
|
|
+--------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| |void| | :ref:`stop<class_AnimationPlayer_method_stop>`\ (\ keep_state\: :ref:`bool<class_bool>` = false\ ) |
|
|
+--------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
|
.. rst-class:: classref-section-separator
|
|
|
|
----
|
|
|
|
.. rst-class:: classref-descriptions-group
|
|
|
|
Señales
|
|
--------------
|
|
|
|
.. _class_AnimationPlayer_signal_animation_changed:
|
|
|
|
.. rst-class:: classref-signal
|
|
|
|
**animation_changed**\ (\ old_name\: :ref:`StringName<class_StringName>`, new_name\: :ref:`StringName<class_StringName>`\ ) :ref:`🔗<class_AnimationPlayer_signal_animation_changed>`
|
|
|
|
Emitted when a queued animation plays after the previous animation finished. See also :ref:`queue()<class_AnimationPlayer_method_queue>`.
|
|
|
|
\ **Note:** The signal is not emitted when the animation is changed via :ref:`play()<class_AnimationPlayer_method_play>` or by an :ref:`AnimationTree<class_AnimationTree>`.
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _class_AnimationPlayer_signal_current_animation_changed:
|
|
|
|
.. rst-class:: classref-signal
|
|
|
|
**current_animation_changed**\ (\ name\: :ref:`StringName<class_StringName>`\ ) :ref:`🔗<class_AnimationPlayer_signal_current_animation_changed>`
|
|
|
|
Emitida cuando :ref:`current_animation<class_AnimationPlayer_property_current_animation>` cambia.
|
|
|
|
.. rst-class:: classref-section-separator
|
|
|
|
----
|
|
|
|
.. rst-class:: classref-descriptions-group
|
|
|
|
Enumeraciones
|
|
--------------------------
|
|
|
|
.. _enum_AnimationPlayer_AnimationProcessCallback:
|
|
|
|
.. rst-class:: classref-enumeration
|
|
|
|
enum **AnimationProcessCallback**: :ref:`🔗<enum_AnimationPlayer_AnimationProcessCallback>`
|
|
|
|
.. _class_AnimationPlayer_constant_ANIMATION_PROCESS_PHYSICS:
|
|
|
|
.. rst-class:: classref-enumeration-constant
|
|
|
|
:ref:`AnimationProcessCallback<enum_AnimationPlayer_AnimationProcessCallback>` **ANIMATION_PROCESS_PHYSICS** = ``0``
|
|
|
|
**Obsoleto:** See :ref:`AnimationMixer.ANIMATION_CALLBACK_MODE_PROCESS_PHYSICS<class_AnimationMixer_constant_ANIMATION_CALLBACK_MODE_PROCESS_PHYSICS>`.
|
|
|
|
|
|
|
|
.. _class_AnimationPlayer_constant_ANIMATION_PROCESS_IDLE:
|
|
|
|
.. rst-class:: classref-enumeration-constant
|
|
|
|
:ref:`AnimationProcessCallback<enum_AnimationPlayer_AnimationProcessCallback>` **ANIMATION_PROCESS_IDLE** = ``1``
|
|
|
|
**Obsoleto:** See :ref:`AnimationMixer.ANIMATION_CALLBACK_MODE_PROCESS_IDLE<class_AnimationMixer_constant_ANIMATION_CALLBACK_MODE_PROCESS_IDLE>`.
|
|
|
|
|
|
|
|
.. _class_AnimationPlayer_constant_ANIMATION_PROCESS_MANUAL:
|
|
|
|
.. rst-class:: classref-enumeration-constant
|
|
|
|
:ref:`AnimationProcessCallback<enum_AnimationPlayer_AnimationProcessCallback>` **ANIMATION_PROCESS_MANUAL** = ``2``
|
|
|
|
**Obsoleto:** See :ref:`AnimationMixer.ANIMATION_CALLBACK_MODE_PROCESS_MANUAL<class_AnimationMixer_constant_ANIMATION_CALLBACK_MODE_PROCESS_MANUAL>`.
|
|
|
|
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _enum_AnimationPlayer_AnimationMethodCallMode:
|
|
|
|
.. rst-class:: classref-enumeration
|
|
|
|
enum **AnimationMethodCallMode**: :ref:`🔗<enum_AnimationPlayer_AnimationMethodCallMode>`
|
|
|
|
.. _class_AnimationPlayer_constant_ANIMATION_METHOD_CALL_DEFERRED:
|
|
|
|
.. rst-class:: classref-enumeration-constant
|
|
|
|
:ref:`AnimationMethodCallMode<enum_AnimationPlayer_AnimationMethodCallMode>` **ANIMATION_METHOD_CALL_DEFERRED** = ``0``
|
|
|
|
**Obsoleto:** See :ref:`AnimationMixer.ANIMATION_CALLBACK_MODE_METHOD_DEFERRED<class_AnimationMixer_constant_ANIMATION_CALLBACK_MODE_METHOD_DEFERRED>`.
|
|
|
|
|
|
|
|
.. _class_AnimationPlayer_constant_ANIMATION_METHOD_CALL_IMMEDIATE:
|
|
|
|
.. rst-class:: classref-enumeration-constant
|
|
|
|
:ref:`AnimationMethodCallMode<enum_AnimationPlayer_AnimationMethodCallMode>` **ANIMATION_METHOD_CALL_IMMEDIATE** = ``1``
|
|
|
|
**Obsoleto:** See :ref:`AnimationMixer.ANIMATION_CALLBACK_MODE_METHOD_IMMEDIATE<class_AnimationMixer_constant_ANIMATION_CALLBACK_MODE_METHOD_IMMEDIATE>`.
|
|
|
|
|
|
|
|
.. rst-class:: classref-section-separator
|
|
|
|
----
|
|
|
|
.. rst-class:: classref-descriptions-group
|
|
|
|
Descripciones de Propiedades
|
|
--------------------------------------------------------
|
|
|
|
.. _class_AnimationPlayer_property_assigned_animation:
|
|
|
|
.. rst-class:: classref-property
|
|
|
|
:ref:`StringName<class_StringName>` **assigned_animation** :ref:`🔗<class_AnimationPlayer_property_assigned_animation>`
|
|
|
|
.. rst-class:: classref-property-setget
|
|
|
|
- |void| **set_assigned_animation**\ (\ value\: :ref:`StringName<class_StringName>`\ )
|
|
- :ref:`StringName<class_StringName>` **get_assigned_animation**\ (\ )
|
|
|
|
Si se está reproduciendo, la clave de la animación actual; en caso contrario, la de la última animación reproducida. Cuando se establece, esto cambia la animación, pero no la reproducirá a menos que ya se esté reproduciendo. Véase también :ref:`current_animation<class_AnimationPlayer_property_current_animation>`.
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _class_AnimationPlayer_property_autoplay:
|
|
|
|
.. rst-class:: classref-property
|
|
|
|
:ref:`StringName<class_StringName>` **autoplay** = ``&""`` :ref:`🔗<class_AnimationPlayer_property_autoplay>`
|
|
|
|
.. rst-class:: classref-property-setget
|
|
|
|
- |void| **set_autoplay**\ (\ value\: :ref:`StringName<class_StringName>`\ )
|
|
- :ref:`StringName<class_StringName>` **get_autoplay**\ (\ )
|
|
|
|
La clave de la animación que se reproducirá cuando se cargue la escena.
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _class_AnimationPlayer_property_current_animation:
|
|
|
|
.. rst-class:: classref-property
|
|
|
|
:ref:`StringName<class_StringName>` **current_animation** = ``&""`` :ref:`🔗<class_AnimationPlayer_property_current_animation>`
|
|
|
|
.. rst-class:: classref-property-setget
|
|
|
|
- |void| **set_current_animation**\ (\ value\: :ref:`StringName<class_StringName>`\ )
|
|
- :ref:`StringName<class_StringName>` **get_current_animation**\ (\ )
|
|
|
|
La clave de la animación que se está reproduciendo actualmente. Si no se está reproduciendo ninguna animación, el valor de la propiedad es una string vacía. Cambiar este valor no reinicia la animación. Véase :ref:`play()<class_AnimationPlayer_method_play>` para más información sobre la reproducción de animaciones.
|
|
|
|
\ **Nota:** Aunque esta propiedad aparece en el Inspector, no está pensada para ser editada y no se guarda en la escena. Esta propiedad se usa principalmente para obtener la animación que se está reproduciendo actualmente, e internamente para las pistas de reproducción de animación. Para más información, véase :ref:`Animation<class_Animation>`.
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _class_AnimationPlayer_property_current_animation_length:
|
|
|
|
.. rst-class:: classref-property
|
|
|
|
:ref:`float<class_float>` **current_animation_length** :ref:`🔗<class_AnimationPlayer_property_current_animation_length>`
|
|
|
|
.. rst-class:: classref-property-setget
|
|
|
|
- :ref:`float<class_float>` **get_current_animation_length**\ (\ )
|
|
|
|
La duración (en segundos) de la animación que se está reproduciendo actualmente.
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _class_AnimationPlayer_property_current_animation_position:
|
|
|
|
.. rst-class:: classref-property
|
|
|
|
:ref:`float<class_float>` **current_animation_position** :ref:`🔗<class_AnimationPlayer_property_current_animation_position>`
|
|
|
|
.. rst-class:: classref-property-setget
|
|
|
|
- :ref:`float<class_float>` **get_current_animation_position**\ (\ )
|
|
|
|
La posición (en segundos) de la animación que se está reproduciendo.
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _class_AnimationPlayer_property_movie_quit_on_finish:
|
|
|
|
.. rst-class:: classref-property
|
|
|
|
:ref:`bool<class_bool>` **movie_quit_on_finish** = ``false`` :ref:`🔗<class_AnimationPlayer_property_movie_quit_on_finish>`
|
|
|
|
.. rst-class:: classref-property-setget
|
|
|
|
- |void| **set_movie_quit_on_finish_enabled**\ (\ value\: :ref:`bool<class_bool>`\ )
|
|
- :ref:`bool<class_bool>` **is_movie_quit_on_finish_enabled**\ (\ )
|
|
|
|
If ``true`` and the engine is running in Movie Maker mode (see :ref:`MovieWriter<class_MovieWriter>`), exits the engine with :ref:`SceneTree.quit()<class_SceneTree_method_quit>` as soon as an animation is done playing in this **AnimationPlayer**. A message is printed when the engine quits for this reason.
|
|
|
|
\ **Note:** This obeys the same logic as the :ref:`AnimationMixer.animation_finished<class_AnimationMixer_signal_animation_finished>` signal, so it will not quit the engine if the animation is set to be looping.
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _class_AnimationPlayer_property_playback_auto_capture:
|
|
|
|
.. rst-class:: classref-property
|
|
|
|
:ref:`bool<class_bool>` **playback_auto_capture** = ``true`` :ref:`🔗<class_AnimationPlayer_property_playback_auto_capture>`
|
|
|
|
.. rst-class:: classref-property-setget
|
|
|
|
- |void| **set_auto_capture**\ (\ value\: :ref:`bool<class_bool>`\ )
|
|
- :ref:`bool<class_bool>` **is_auto_capture**\ (\ )
|
|
|
|
If ``true``, performs :ref:`AnimationMixer.capture()<class_AnimationMixer_method_capture>` before playback automatically. This means just :ref:`play_with_capture()<class_AnimationPlayer_method_play_with_capture>` is executed with default arguments instead of :ref:`play()<class_AnimationPlayer_method_play>`.
|
|
|
|
\ **Note:** Capture interpolation is only performed if the animation contains a capture track. See also :ref:`Animation.UPDATE_CAPTURE<class_Animation_constant_UPDATE_CAPTURE>`.
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _class_AnimationPlayer_property_playback_auto_capture_duration:
|
|
|
|
.. rst-class:: classref-property
|
|
|
|
:ref:`float<class_float>` **playback_auto_capture_duration** = ``-1.0`` :ref:`🔗<class_AnimationPlayer_property_playback_auto_capture_duration>`
|
|
|
|
.. rst-class:: classref-property-setget
|
|
|
|
- |void| **set_auto_capture_duration**\ (\ value\: :ref:`float<class_float>`\ )
|
|
- :ref:`float<class_float>` **get_auto_capture_duration**\ (\ )
|
|
|
|
Véase también :ref:`play_with_capture()<class_AnimationPlayer_method_play_with_capture>` y :ref:`AnimationMixer.capture()<class_AnimationMixer_method_capture>`.
|
|
|
|
Si :ref:`playback_auto_capture_duration<class_AnimationPlayer_property_playback_auto_capture_duration>` es un value negativo, la duración se establece al intervalo entre la posición actual y la primera key.
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _class_AnimationPlayer_property_playback_auto_capture_ease_type:
|
|
|
|
.. rst-class:: classref-property
|
|
|
|
:ref:`EaseType<enum_Tween_EaseType>` **playback_auto_capture_ease_type** = ``0`` :ref:`🔗<class_AnimationPlayer_property_playback_auto_capture_ease_type>`
|
|
|
|
.. rst-class:: classref-property-setget
|
|
|
|
- |void| **set_auto_capture_ease_type**\ (\ value\: :ref:`EaseType<enum_Tween_EaseType>`\ )
|
|
- :ref:`EaseType<enum_Tween_EaseType>` **get_auto_capture_ease_type**\ (\ )
|
|
|
|
The ease type of the capture interpolation. See also :ref:`EaseType<enum_Tween_EaseType>`.
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _class_AnimationPlayer_property_playback_auto_capture_transition_type:
|
|
|
|
.. rst-class:: classref-property
|
|
|
|
:ref:`TransitionType<enum_Tween_TransitionType>` **playback_auto_capture_transition_type** = ``0`` :ref:`🔗<class_AnimationPlayer_property_playback_auto_capture_transition_type>`
|
|
|
|
.. rst-class:: classref-property-setget
|
|
|
|
- |void| **set_auto_capture_transition_type**\ (\ value\: :ref:`TransitionType<enum_Tween_TransitionType>`\ )
|
|
- :ref:`TransitionType<enum_Tween_TransitionType>` **get_auto_capture_transition_type**\ (\ )
|
|
|
|
El tipo de transición de la interpolación de captura. Véase :ref:`TransitionType<enum_Tween_TransitionType>`.
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _class_AnimationPlayer_property_playback_default_blend_time:
|
|
|
|
.. rst-class:: classref-property
|
|
|
|
:ref:`float<class_float>` **playback_default_blend_time** = ``0.0`` :ref:`🔗<class_AnimationPlayer_property_playback_default_blend_time>`
|
|
|
|
.. rst-class:: classref-property-setget
|
|
|
|
- |void| **set_default_blend_time**\ (\ value\: :ref:`float<class_float>`\ )
|
|
- :ref:`float<class_float>` **get_default_blend_time**\ (\ )
|
|
|
|
El tiempo por defecto para mezclar las animaciones. Va de 0 a 4096 con una precisión de 0,01.
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _class_AnimationPlayer_property_speed_scale:
|
|
|
|
.. rst-class:: classref-property
|
|
|
|
:ref:`float<class_float>` **speed_scale** = ``1.0`` :ref:`🔗<class_AnimationPlayer_property_speed_scale>`
|
|
|
|
.. rst-class:: classref-property-setget
|
|
|
|
- |void| **set_speed_scale**\ (\ value\: :ref:`float<class_float>`\ )
|
|
- :ref:`float<class_float>` **get_speed_scale**\ (\ )
|
|
|
|
La relación de escala de velocidad. Por ejemplo, si este valor es ``1``, entonces la animación se reproduce a velocidad normal. Si es ``0.5``, entonces se reproduce a media velocidad. Si es ``2``, entonces se reproduce al doble de velocidad.
|
|
|
|
Si se establece en un valor negativo, la animación se reproduce en reversa. Si se establece en ``0``, la animación no avanzará.
|
|
|
|
.. rst-class:: classref-section-separator
|
|
|
|
----
|
|
|
|
.. rst-class:: classref-descriptions-group
|
|
|
|
Descripciones de Métodos
|
|
------------------------------------------------
|
|
|
|
.. _class_AnimationPlayer_method_animation_get_next:
|
|
|
|
.. rst-class:: classref-method
|
|
|
|
:ref:`StringName<class_StringName>` **animation_get_next**\ (\ animation_from\: :ref:`StringName<class_StringName>`\ ) |const| :ref:`🔗<class_AnimationPlayer_method_animation_get_next>`
|
|
|
|
Devuelve la clave de la animación que está en cola para reproducirse después de la animación ``animation_from``.
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _class_AnimationPlayer_method_animation_set_next:
|
|
|
|
.. rst-class:: classref-method
|
|
|
|
|void| **animation_set_next**\ (\ animation_from\: :ref:`StringName<class_StringName>`, animation_to\: :ref:`StringName<class_StringName>`\ ) :ref:`🔗<class_AnimationPlayer_method_animation_set_next>`
|
|
|
|
Dispara la animación ``animation_to`` cuando la animación ``animation_from`` se completa.
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _class_AnimationPlayer_method_clear_queue:
|
|
|
|
.. rst-class:: classref-method
|
|
|
|
|void| **clear_queue**\ (\ ) :ref:`🔗<class_AnimationPlayer_method_clear_queue>`
|
|
|
|
Limpia todas las colas, animaciones no reproducidas.
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _class_AnimationPlayer_method_get_blend_time:
|
|
|
|
.. rst-class:: classref-method
|
|
|
|
:ref:`float<class_float>` **get_blend_time**\ (\ animation_from\: :ref:`StringName<class_StringName>`, animation_to\: :ref:`StringName<class_StringName>`\ ) |const| :ref:`🔗<class_AnimationPlayer_method_get_blend_time>`
|
|
|
|
Devuelve el tiempo de fusión (en segundos) entre dos animaciones, referenciado por sus claves.
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _class_AnimationPlayer_method_get_method_call_mode:
|
|
|
|
.. rst-class:: classref-method
|
|
|
|
:ref:`AnimationMethodCallMode<enum_AnimationPlayer_AnimationMethodCallMode>` **get_method_call_mode**\ (\ ) |const| :ref:`🔗<class_AnimationPlayer_method_get_method_call_mode>`
|
|
|
|
**Obsoleto:** Use :ref:`AnimationMixer.callback_mode_method<class_AnimationMixer_property_callback_mode_method>` instead.
|
|
|
|
Devuelve el modo de llamada utilizado para las pistas de "Call Method".
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _class_AnimationPlayer_method_get_playing_speed:
|
|
|
|
.. rst-class:: classref-method
|
|
|
|
:ref:`float<class_float>` **get_playing_speed**\ (\ ) |const| :ref:`🔗<class_AnimationPlayer_method_get_playing_speed>`
|
|
|
|
Devuelve la velocidad de reproducción real de la animación actual o ``0`` si no se está reproduciendo. Esta velocidad es la propiedad :ref:`speed_scale<class_AnimationPlayer_property_speed_scale>` multiplicada por el argumento ``custom_speed`` especificado al llamar al método :ref:`play()<class_AnimationPlayer_method_play>`.
|
|
|
|
Devuelve un valor negativo si la animación actual se está reproduciendo hacia atrás.
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _class_AnimationPlayer_method_get_process_callback:
|
|
|
|
.. rst-class:: classref-method
|
|
|
|
:ref:`AnimationProcessCallback<enum_AnimationPlayer_AnimationProcessCallback>` **get_process_callback**\ (\ ) |const| :ref:`🔗<class_AnimationPlayer_method_get_process_callback>`
|
|
|
|
**Obsoleto:** Use :ref:`AnimationMixer.callback_mode_process<class_AnimationMixer_property_callback_mode_process>` instead.
|
|
|
|
Devuelve la notificación del proceso en el que se actualizarán las animaciones.
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _class_AnimationPlayer_method_get_queue:
|
|
|
|
.. rst-class:: classref-method
|
|
|
|
:ref:`Array<class_Array>`\[:ref:`StringName<class_StringName>`\] **get_queue**\ (\ ) :ref:`🔗<class_AnimationPlayer_method_get_queue>`
|
|
|
|
Devuelve una lista de las claves de animación que están actualmente en cola para reproducirse.
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _class_AnimationPlayer_method_get_root:
|
|
|
|
.. rst-class:: classref-method
|
|
|
|
:ref:`NodePath<class_NodePath>` **get_root**\ (\ ) |const| :ref:`🔗<class_AnimationPlayer_method_get_root>`
|
|
|
|
**Obsoleto:** Use :ref:`AnimationMixer.root_node<class_AnimationMixer_property_root_node>` instead.
|
|
|
|
Devuelve el nodo desde el cual viajarán las referencias de la ruta de nodos.
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _class_AnimationPlayer_method_get_section_end_time:
|
|
|
|
.. rst-class:: classref-method
|
|
|
|
:ref:`float<class_float>` **get_section_end_time**\ (\ ) |const| :ref:`🔗<class_AnimationPlayer_method_get_section_end_time>`
|
|
|
|
Devuelve el tiempo de finalización de la sección que se está reproduciendo actualmente.
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _class_AnimationPlayer_method_get_section_start_time:
|
|
|
|
.. rst-class:: classref-method
|
|
|
|
:ref:`float<class_float>` **get_section_start_time**\ (\ ) |const| :ref:`🔗<class_AnimationPlayer_method_get_section_start_time>`
|
|
|
|
Devuelve el tiempo de inicio de la sección que se está reproduciendo actualmente.
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _class_AnimationPlayer_method_has_section:
|
|
|
|
.. rst-class:: classref-method
|
|
|
|
:ref:`bool<class_bool>` **has_section**\ (\ ) |const| :ref:`🔗<class_AnimationPlayer_method_has_section>`
|
|
|
|
Devuelve ``true`` si una animación se está reproduciendo actualmente con una sección.
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _class_AnimationPlayer_method_is_animation_active:
|
|
|
|
.. rst-class:: classref-method
|
|
|
|
:ref:`bool<class_bool>` **is_animation_active**\ (\ ) |const| :ref:`🔗<class_AnimationPlayer_method_is_animation_active>`
|
|
|
|
Returns ``true`` if the an animation is currently active. An animation is active if it was played by calling :ref:`play()<class_AnimationPlayer_method_play>` and was not finished yet, or was stopped by calling :ref:`stop()<class_AnimationPlayer_method_stop>`.
|
|
|
|
This can be used to check whether an animation is currently paused or stopped.
|
|
|
|
::
|
|
|
|
var is_paused = not is_playing() and is_animation_active()
|
|
var is_stopped = not is_playing() and not is_animation_active()
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _class_AnimationPlayer_method_is_playing:
|
|
|
|
.. rst-class:: classref-method
|
|
|
|
:ref:`bool<class_bool>` **is_playing**\ (\ ) |const| :ref:`🔗<class_AnimationPlayer_method_is_playing>`
|
|
|
|
Devuelve ``true`` si una animación se está reproduciendo actualmente (incluso si :ref:`speed_scale<class_AnimationPlayer_property_speed_scale>` y/o ``custom_speed`` son ``0``).
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _class_AnimationPlayer_method_pause:
|
|
|
|
.. rst-class:: classref-method
|
|
|
|
|void| **pause**\ (\ ) :ref:`🔗<class_AnimationPlayer_method_pause>`
|
|
|
|
Pauses the currently playing animation. The :ref:`current_animation_position<class_AnimationPlayer_property_current_animation_position>` will be kept and calling :ref:`play()<class_AnimationPlayer_method_play>` or :ref:`play_backwards()<class_AnimationPlayer_method_play_backwards>` without arguments or with the same animation name as :ref:`assigned_animation<class_AnimationPlayer_property_assigned_animation>` will resume the animation.
|
|
|
|
See also :ref:`stop()<class_AnimationPlayer_method_stop>`.
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _class_AnimationPlayer_method_play:
|
|
|
|
.. rst-class:: classref-method
|
|
|
|
|void| **play**\ (\ name\: :ref:`StringName<class_StringName>` = &"", custom_blend\: :ref:`float<class_float>` = -1, custom_speed\: :ref:`float<class_float>` = 1.0, from_end\: :ref:`bool<class_bool>` = false\ ) :ref:`🔗<class_AnimationPlayer_method_play>`
|
|
|
|
Plays the animation with key ``name``. Custom blend times and speed can be set.
|
|
|
|
The ``from_end`` option only affects when switching to a new animation track, or if the same track but at the start or end. It does not affect resuming playback that was paused in the middle of an animation. If ``custom_speed`` is negative and ``from_end`` is ``true``, the animation will play backwards (which is equivalent to calling :ref:`play_backwards()<class_AnimationPlayer_method_play_backwards>`).
|
|
|
|
The **AnimationPlayer** keeps track of its current or last played animation with :ref:`assigned_animation<class_AnimationPlayer_property_assigned_animation>`. If this method is called with that same animation ``name``, or with no ``name`` parameter, the assigned animation will resume playing if it was paused.
|
|
|
|
\ **Note:** The animation will be updated the next time the **AnimationPlayer** is processed. If other variables are updated at the same time this is called, they may be updated too early. To perform the update immediately, call ``advance(0)``.
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _class_AnimationPlayer_method_play_backwards:
|
|
|
|
.. rst-class:: classref-method
|
|
|
|
|void| **play_backwards**\ (\ name\: :ref:`StringName<class_StringName>` = &"", custom_blend\: :ref:`float<class_float>` = -1\ ) :ref:`🔗<class_AnimationPlayer_method_play_backwards>`
|
|
|
|
Reproduce la animación con la clave ``name`` al revés.
|
|
|
|
Este método es una abreviatura de :ref:`play()<class_AnimationPlayer_method_play>` con ``custom_speed = -1.0`` y ``from_end = true``, así que consulta su descripción para obtener más información.
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _class_AnimationPlayer_method_play_section:
|
|
|
|
.. rst-class:: classref-method
|
|
|
|
|void| **play_section**\ (\ name\: :ref:`StringName<class_StringName>` = &"", start_time\: :ref:`float<class_float>` = -1, end_time\: :ref:`float<class_float>` = -1, custom_blend\: :ref:`float<class_float>` = -1, custom_speed\: :ref:`float<class_float>` = 1.0, from_end\: :ref:`bool<class_bool>` = false\ ) :ref:`🔗<class_AnimationPlayer_method_play_section>`
|
|
|
|
Reproduce la animación con la clave ``name`` y la sección que comienza en ``start_time`` y termina en ``end_time``. Véase también :ref:`play()<class_AnimationPlayer_method_play>`.
|
|
|
|
Establecer ``start_time`` a un valor fuera del rango de la animación significa que se usará el inicio de la animación en su lugar, y establecer ``end_time`` a un valor fuera del rango de la animación significa que se usará el final de la animación en su lugar. ``start_time`` no puede ser igual a ``end_time``.
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _class_AnimationPlayer_method_play_section_backwards:
|
|
|
|
.. rst-class:: classref-method
|
|
|
|
|void| **play_section_backwards**\ (\ name\: :ref:`StringName<class_StringName>` = &"", start_time\: :ref:`float<class_float>` = -1, end_time\: :ref:`float<class_float>` = -1, custom_blend\: :ref:`float<class_float>` = -1\ ) :ref:`🔗<class_AnimationPlayer_method_play_section_backwards>`
|
|
|
|
Reproduce la animación con la clave ``name`` y la sección que comienza en ``start_time`` y termina en ``end_time`` en reversa.
|
|
|
|
Este método es una abreviatura de :ref:`play_section()<class_AnimationPlayer_method_play_section>` con ``custom_speed = -1.0`` y ``from_end = true``, consulta su descripción para más información.
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _class_AnimationPlayer_method_play_section_with_markers:
|
|
|
|
.. rst-class:: classref-method
|
|
|
|
|void| **play_section_with_markers**\ (\ name\: :ref:`StringName<class_StringName>` = &"", start_marker\: :ref:`StringName<class_StringName>` = &"", end_marker\: :ref:`StringName<class_StringName>` = &"", custom_blend\: :ref:`float<class_float>` = -1, custom_speed\: :ref:`float<class_float>` = 1.0, from_end\: :ref:`bool<class_bool>` = false\ ) :ref:`🔗<class_AnimationPlayer_method_play_section_with_markers>`
|
|
|
|
Reproduce la animación con la clave ``name`` y la sección que comienza en el marcador ``start_marker`` y termina en ``end_marker``.
|
|
|
|
Si el marcador de inicio está vacío, la sección comienza desde el principio de la animación. Si el marcador de fin está vacío, la sección termina al final de la animación. Véase también :ref:`play()<class_AnimationPlayer_method_play>`.
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _class_AnimationPlayer_method_play_section_with_markers_backwards:
|
|
|
|
.. rst-class:: classref-method
|
|
|
|
|void| **play_section_with_markers_backwards**\ (\ name\: :ref:`StringName<class_StringName>` = &"", start_marker\: :ref:`StringName<class_StringName>` = &"", end_marker\: :ref:`StringName<class_StringName>` = &"", custom_blend\: :ref:`float<class_float>` = -1\ ) :ref:`🔗<class_AnimationPlayer_method_play_section_with_markers_backwards>`
|
|
|
|
Reproduce la animación con la clave ``name`` y la sección que comienza en el marcador ``start_marker`` y termina en el marcador ``end_marker`` en reversa.
|
|
|
|
Este método es una abreviatura de :ref:`play_section_with_markers()<class_AnimationPlayer_method_play_section_with_markers>` con ``custom_speed = -1.0`` y ``from_end = true``, consulta su descripción para más información.
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _class_AnimationPlayer_method_play_with_capture:
|
|
|
|
.. rst-class:: classref-method
|
|
|
|
|void| **play_with_capture**\ (\ name\: :ref:`StringName<class_StringName>` = &"", duration\: :ref:`float<class_float>` = -1.0, custom_blend\: :ref:`float<class_float>` = -1, custom_speed\: :ref:`float<class_float>` = 1.0, from_end\: :ref:`bool<class_bool>` = false, trans_type\: :ref:`TransitionType<enum_Tween_TransitionType>` = 0, ease_type\: :ref:`EaseType<enum_Tween_EaseType>` = 0\ ) :ref:`🔗<class_AnimationPlayer_method_play_with_capture>`
|
|
|
|
See also :ref:`AnimationMixer.capture()<class_AnimationMixer_method_capture>`.
|
|
|
|
You can use this method to use more detailed options for capture than those performed by :ref:`playback_auto_capture<class_AnimationPlayer_property_playback_auto_capture>`. When :ref:`playback_auto_capture<class_AnimationPlayer_property_playback_auto_capture>` is ``false``, this method is almost the same as the following:
|
|
|
|
::
|
|
|
|
capture(name, duration, trans_type, ease_type)
|
|
play(name, custom_blend, custom_speed, from_end)
|
|
|
|
If ``name`` is blank, it specifies :ref:`assigned_animation<class_AnimationPlayer_property_assigned_animation>`.
|
|
|
|
If ``duration`` is a negative value, the duration is set to the interval between the current position and the first key, when ``from_end`` is ``true``, uses the interval between the current position and the last key instead.
|
|
|
|
\ **Note:** The ``duration`` takes :ref:`speed_scale<class_AnimationPlayer_property_speed_scale>` into account, but ``custom_speed`` does not, because the capture cache is interpolated with the blend result and the result may contain multiple animations.
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _class_AnimationPlayer_method_queue:
|
|
|
|
.. rst-class:: classref-method
|
|
|
|
|void| **queue**\ (\ name\: :ref:`StringName<class_StringName>`\ ) :ref:`🔗<class_AnimationPlayer_method_queue>`
|
|
|
|
Pone en cola una animación para su reproducción una vez que la animación actual y todas las animaciones previamente encoladas hayan terminado.
|
|
|
|
\ **Nota:** Si una animación en bucle se está reproduciendo actualmente, la animación en cola nunca se reproducirá a menos que la animación en bucle se detenga de alguna manera.
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _class_AnimationPlayer_method_reset_section:
|
|
|
|
.. rst-class:: classref-method
|
|
|
|
|void| **reset_section**\ (\ ) :ref:`🔗<class_AnimationPlayer_method_reset_section>`
|
|
|
|
Restablece la sección actual. No realiza ninguna acción si no se ha definido una sección.
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _class_AnimationPlayer_method_seek:
|
|
|
|
.. rst-class:: classref-method
|
|
|
|
|void| **seek**\ (\ seconds\: :ref:`float<class_float>`, update\: :ref:`bool<class_bool>` = false, update_only\: :ref:`bool<class_bool>` = false\ ) :ref:`🔗<class_AnimationPlayer_method_seek>`
|
|
|
|
Busca la animación hasta el punto en el tiempo ``seconds`` (en segundos). Si ``update`` es ``true``, la animación también se actualiza; de lo contrario, se actualiza en el tiempo de procesado. Los eventos entre el fotograma actual y ``seconds`` se omiten.
|
|
|
|
Si ``update_only`` es ``true``, las pistas de reproducción de método/audio/animación no se procesarán.
|
|
|
|
\ **Nota:** Buscar hasta el final de la animación no emite :ref:`AnimationMixer.animation_finished<class_AnimationMixer_signal_animation_finished>`. Si quieres saltar la animación y emitir la señal, usa :ref:`AnimationMixer.advance()<class_AnimationMixer_method_advance>`.
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _class_AnimationPlayer_method_set_blend_time:
|
|
|
|
.. rst-class:: classref-method
|
|
|
|
|void| **set_blend_time**\ (\ animation_from\: :ref:`StringName<class_StringName>`, animation_to\: :ref:`StringName<class_StringName>`, sec\: :ref:`float<class_float>`\ ) :ref:`🔗<class_AnimationPlayer_method_set_blend_time>`
|
|
|
|
Especifica un tiempo de mezcla (en segundos) entre dos animaciones, referenciadas por sus nombres.
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _class_AnimationPlayer_method_set_method_call_mode:
|
|
|
|
.. rst-class:: classref-method
|
|
|
|
|void| **set_method_call_mode**\ (\ mode\: :ref:`AnimationMethodCallMode<enum_AnimationPlayer_AnimationMethodCallMode>`\ ) :ref:`🔗<class_AnimationPlayer_method_set_method_call_mode>`
|
|
|
|
**Obsoleto:** Use :ref:`AnimationMixer.callback_mode_method<class_AnimationMixer_property_callback_mode_method>` instead.
|
|
|
|
Sets the call mode used for "Call Method" tracks.
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _class_AnimationPlayer_method_set_process_callback:
|
|
|
|
.. rst-class:: classref-method
|
|
|
|
|void| **set_process_callback**\ (\ mode\: :ref:`AnimationProcessCallback<enum_AnimationPlayer_AnimationProcessCallback>`\ ) :ref:`🔗<class_AnimationPlayer_method_set_process_callback>`
|
|
|
|
**Obsoleto:** Use :ref:`AnimationMixer.callback_mode_process<class_AnimationMixer_property_callback_mode_process>` instead.
|
|
|
|
Establece la notificación de proceso en la que se actualizan las animaciones.
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _class_AnimationPlayer_method_set_root:
|
|
|
|
.. rst-class:: classref-method
|
|
|
|
|void| **set_root**\ (\ path\: :ref:`NodePath<class_NodePath>`\ ) :ref:`🔗<class_AnimationPlayer_method_set_root>`
|
|
|
|
**Obsoleto:** Use :ref:`AnimationMixer.root_node<class_AnimationMixer_property_root_node>` instead.
|
|
|
|
Establece el nodo desde el cual viajarán las referencias de la ruta de nodos.
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _class_AnimationPlayer_method_set_section:
|
|
|
|
.. rst-class:: classref-method
|
|
|
|
|void| **set_section**\ (\ start_time\: :ref:`float<class_float>` = -1, end_time\: :ref:`float<class_float>` = -1\ ) :ref:`🔗<class_AnimationPlayer_method_set_section>`
|
|
|
|
Cambia los tiempos de inicio y fin de la sección que se está reproduciendo. La posición de reproducción actual se limitará dentro de la nueva sección. Véase también :ref:`play_section()<class_AnimationPlayer_method_play_section>`.
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _class_AnimationPlayer_method_set_section_with_markers:
|
|
|
|
.. rst-class:: classref-method
|
|
|
|
|void| **set_section_with_markers**\ (\ start_marker\: :ref:`StringName<class_StringName>` = &"", end_marker\: :ref:`StringName<class_StringName>` = &""\ ) :ref:`🔗<class_AnimationPlayer_method_set_section_with_markers>`
|
|
|
|
Cambia los marcadores de inicio y fin de la sección que se está reproduciendo. La posición de reproducción actual se limitará dentro de la nueva sección. Véase también :ref:`play_section_with_markers()<class_AnimationPlayer_method_play_section_with_markers>`.
|
|
|
|
Si el argumento está vacío, la sección utiliza el principio o el final de la animación. Si ambos están vacíos, significa que la sección no está establecida.
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _class_AnimationPlayer_method_stop:
|
|
|
|
.. rst-class:: classref-method
|
|
|
|
|void| **stop**\ (\ keep_state\: :ref:`bool<class_bool>` = false\ ) :ref:`🔗<class_AnimationPlayer_method_stop>`
|
|
|
|
Stops the currently playing animation. The animation position is reset to ``0`` and the ``custom_speed`` is reset to ``1.0``. See also :ref:`pause()<class_AnimationPlayer_method_pause>`.
|
|
|
|
If ``keep_state`` is ``true``, the animation state is not updated visually.
|
|
|
|
\ **Note:** The method / audio / animation playback tracks will not be processed by this method.
|
|
|
|
.. |virtual| replace:: :abbr:`virtual (Normalmente, este método debería ser sobreescrito por el usuario para que tenga algún efecto.)`
|
|
.. |required| replace:: :abbr:`required (This method is required to be overridden when extending its base class.)`
|
|
.. |const| replace:: :abbr:`const (Este método no tiene efectos secundarios. No modifica ninguna de las variables miembro de la instancia.)`
|
|
.. |vararg| replace:: :abbr:`vararg (Este método permite agregar cualquier número de argumentos después de los descritos aquí.)`
|
|
.. |constructor| replace:: :abbr:`constructor (Este método se utiliza para construir un tipo.)`
|
|
.. |static| replace:: :abbr:`static (Este método no necesita una instancia para ser llamado, por lo que puede llamarse directamente utilizando el nombre de la clase.)`
|
|
.. |operator| replace:: :abbr:`operator (Este método describe un operador válido para usar con este tipo como operando izquierdo.)`
|
|
.. |bitfield| replace:: :abbr:`BitField (Este valor es un entero compuesto como una máscara de bits de las siguientes banderas.)`
|
|
.. |void| replace:: :abbr:`void (Sin valor de retorno.)`
|