mirror of
https://github.com/godotengine/godot-docs-l10n.git
synced 2025-12-31 09:49:22 +03:00
924 lines
56 KiB
ReStructuredText
924 lines
56 KiB
ReStructuredText
:github_url: hide
|
|
|
|
.. _class_SceneTree:
|
|
|
|
SceneTree
|
|
=========
|
|
|
|
**Hereda:** :ref:`MainLoop<class_MainLoop>` **<** :ref:`Object<class_Object>`
|
|
|
|
Maneja el bucle del juego a través de una jerarquía de nodos.
|
|
|
|
.. rst-class:: classref-introduction-group
|
|
|
|
Descripción
|
|
----------------------
|
|
|
|
As one of the most important classes, the **SceneTree** manages the hierarchy of nodes in a scene, as well as scenes themselves. Nodes can be added, fetched and removed. The whole scene tree (and thus the current scene) can be paused. Scenes can be loaded, switched and reloaded.
|
|
|
|
You can also use the **SceneTree** to organize your nodes into **groups**: every node can be added to as many groups as you want to create, e.g. an "enemy" group. You can then iterate these groups or even call methods and set properties on all the nodes belonging to any given group.
|
|
|
|
\ **SceneTree** is the default :ref:`MainLoop<class_MainLoop>` implementation used by the engine, and is thus in charge of the game loop.
|
|
|
|
.. rst-class:: classref-introduction-group
|
|
|
|
Tutoriales
|
|
--------------------
|
|
|
|
- :doc:`Árbol de Escenas <../tutorials/scripting/scene_tree>`
|
|
|
|
- :doc:`Múltiples resoluciones <../tutorials/rendering/multiple_resolutions>`
|
|
|
|
.. rst-class:: classref-reftable-group
|
|
|
|
Propiedades
|
|
----------------------
|
|
|
|
.. table::
|
|
:widths: auto
|
|
|
|
+-----------------------------+------------------------------------------------------------------------------+-----------+
|
|
| :ref:`bool<class_bool>` | :ref:`auto_accept_quit<class_SceneTree_property_auto_accept_quit>` | ``true`` |
|
|
+-----------------------------+------------------------------------------------------------------------------+-----------+
|
|
| :ref:`Node<class_Node>` | :ref:`current_scene<class_SceneTree_property_current_scene>` | |
|
|
+-----------------------------+------------------------------------------------------------------------------+-----------+
|
|
| :ref:`bool<class_bool>` | :ref:`debug_collisions_hint<class_SceneTree_property_debug_collisions_hint>` | ``false`` |
|
|
+-----------------------------+------------------------------------------------------------------------------+-----------+
|
|
| :ref:`bool<class_bool>` | :ref:`debug_navigation_hint<class_SceneTree_property_debug_navigation_hint>` | ``false`` |
|
|
+-----------------------------+------------------------------------------------------------------------------+-----------+
|
|
| :ref:`bool<class_bool>` | :ref:`debug_paths_hint<class_SceneTree_property_debug_paths_hint>` | ``false`` |
|
|
+-----------------------------+------------------------------------------------------------------------------+-----------+
|
|
| :ref:`Node<class_Node>` | :ref:`edited_scene_root<class_SceneTree_property_edited_scene_root>` | |
|
|
+-----------------------------+------------------------------------------------------------------------------+-----------+
|
|
| :ref:`bool<class_bool>` | :ref:`multiplayer_poll<class_SceneTree_property_multiplayer_poll>` | ``true`` |
|
|
+-----------------------------+------------------------------------------------------------------------------+-----------+
|
|
| :ref:`bool<class_bool>` | :ref:`paused<class_SceneTree_property_paused>` | ``false`` |
|
|
+-----------------------------+------------------------------------------------------------------------------+-----------+
|
|
| :ref:`bool<class_bool>` | :ref:`physics_interpolation<class_SceneTree_property_physics_interpolation>` | ``false`` |
|
|
+-----------------------------+------------------------------------------------------------------------------+-----------+
|
|
| :ref:`bool<class_bool>` | :ref:`quit_on_go_back<class_SceneTree_property_quit_on_go_back>` | ``true`` |
|
|
+-----------------------------+------------------------------------------------------------------------------+-----------+
|
|
| :ref:`Window<class_Window>` | :ref:`root<class_SceneTree_property_root>` | |
|
|
+-----------------------------+------------------------------------------------------------------------------+-----------+
|
|
|
|
.. rst-class:: classref-reftable-group
|
|
|
|
Métodos
|
|
--------------
|
|
|
|
.. table::
|
|
:widths: auto
|
|
|
|
+--------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| |void| | :ref:`call_group<class_SceneTree_method_call_group>`\ (\ group\: :ref:`StringName<class_StringName>`, method\: :ref:`StringName<class_StringName>`, ...\ ) |vararg| |
|
|
+--------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| |void| | :ref:`call_group_flags<class_SceneTree_method_call_group_flags>`\ (\ flags\: :ref:`int<class_int>`, group\: :ref:`StringName<class_StringName>`, method\: :ref:`StringName<class_StringName>`, ...\ ) |vararg| |
|
|
+--------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`Error<enum_@GlobalScope_Error>` | :ref:`change_scene_to_file<class_SceneTree_method_change_scene_to_file>`\ (\ path\: :ref:`String<class_String>`\ ) |
|
|
+--------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`Error<enum_@GlobalScope_Error>` | :ref:`change_scene_to_node<class_SceneTree_method_change_scene_to_node>`\ (\ node\: :ref:`Node<class_Node>`\ ) |
|
|
+--------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`Error<enum_@GlobalScope_Error>` | :ref:`change_scene_to_packed<class_SceneTree_method_change_scene_to_packed>`\ (\ packed_scene\: :ref:`PackedScene<class_PackedScene>`\ ) |
|
|
+--------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`SceneTreeTimer<class_SceneTreeTimer>` | :ref:`create_timer<class_SceneTree_method_create_timer>`\ (\ time_sec\: :ref:`float<class_float>`, process_always\: :ref:`bool<class_bool>` = true, process_in_physics\: :ref:`bool<class_bool>` = false, ignore_time_scale\: :ref:`bool<class_bool>` = false\ ) |
|
|
+--------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`Tween<class_Tween>` | :ref:`create_tween<class_SceneTree_method_create_tween>`\ (\ ) |
|
|
+--------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`Node<class_Node>` | :ref:`get_first_node_in_group<class_SceneTree_method_get_first_node_in_group>`\ (\ group\: :ref:`StringName<class_StringName>`\ ) |
|
|
+--------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`int<class_int>` | :ref:`get_frame<class_SceneTree_method_get_frame>`\ (\ ) |const| |
|
|
+--------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`MultiplayerAPI<class_MultiplayerAPI>` | :ref:`get_multiplayer<class_SceneTree_method_get_multiplayer>`\ (\ for_path\: :ref:`NodePath<class_NodePath>` = NodePath("")\ ) |const| |
|
|
+--------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`int<class_int>` | :ref:`get_node_count<class_SceneTree_method_get_node_count>`\ (\ ) |const| |
|
|
+--------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`int<class_int>` | :ref:`get_node_count_in_group<class_SceneTree_method_get_node_count_in_group>`\ (\ group\: :ref:`StringName<class_StringName>`\ ) |const| |
|
|
+--------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`Array<class_Array>`\[:ref:`Node<class_Node>`\] | :ref:`get_nodes_in_group<class_SceneTree_method_get_nodes_in_group>`\ (\ group\: :ref:`StringName<class_StringName>`\ ) |
|
|
+--------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`Array<class_Array>`\[:ref:`Tween<class_Tween>`\] | :ref:`get_processed_tweens<class_SceneTree_method_get_processed_tweens>`\ (\ ) |
|
|
+--------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`bool<class_bool>` | :ref:`has_group<class_SceneTree_method_has_group>`\ (\ name\: :ref:`StringName<class_StringName>`\ ) |const| |
|
|
+--------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`bool<class_bool>` | :ref:`is_accessibility_enabled<class_SceneTree_method_is_accessibility_enabled>`\ (\ ) |const| |
|
|
+--------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`bool<class_bool>` | :ref:`is_accessibility_supported<class_SceneTree_method_is_accessibility_supported>`\ (\ ) |const| |
|
|
+--------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| |void| | :ref:`notify_group<class_SceneTree_method_notify_group>`\ (\ group\: :ref:`StringName<class_StringName>`, notification\: :ref:`int<class_int>`\ ) |
|
|
+--------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| |void| | :ref:`notify_group_flags<class_SceneTree_method_notify_group_flags>`\ (\ call_flags\: :ref:`int<class_int>`, group\: :ref:`StringName<class_StringName>`, notification\: :ref:`int<class_int>`\ ) |
|
|
+--------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| |void| | :ref:`queue_delete<class_SceneTree_method_queue_delete>`\ (\ obj\: :ref:`Object<class_Object>`\ ) |
|
|
+--------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| |void| | :ref:`quit<class_SceneTree_method_quit>`\ (\ exit_code\: :ref:`int<class_int>` = 0\ ) |
|
|
+--------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`Error<enum_@GlobalScope_Error>` | :ref:`reload_current_scene<class_SceneTree_method_reload_current_scene>`\ (\ ) |
|
|
+--------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| |void| | :ref:`set_group<class_SceneTree_method_set_group>`\ (\ group\: :ref:`StringName<class_StringName>`, property\: :ref:`String<class_String>`, value\: :ref:`Variant<class_Variant>`\ ) |
|
|
+--------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| |void| | :ref:`set_group_flags<class_SceneTree_method_set_group_flags>`\ (\ call_flags\: :ref:`int<class_int>`, group\: :ref:`StringName<class_StringName>`, property\: :ref:`String<class_String>`, value\: :ref:`Variant<class_Variant>`\ ) |
|
|
+--------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| |void| | :ref:`set_multiplayer<class_SceneTree_method_set_multiplayer>`\ (\ multiplayer\: :ref:`MultiplayerAPI<class_MultiplayerAPI>`, root_path\: :ref:`NodePath<class_NodePath>` = NodePath("")\ ) |
|
|
+--------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| |void| | :ref:`unload_current_scene<class_SceneTree_method_unload_current_scene>`\ (\ ) |
|
|
+--------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
|
.. rst-class:: classref-section-separator
|
|
|
|
----
|
|
|
|
.. rst-class:: classref-descriptions-group
|
|
|
|
Señales
|
|
--------------
|
|
|
|
.. _class_SceneTree_signal_node_added:
|
|
|
|
.. rst-class:: classref-signal
|
|
|
|
**node_added**\ (\ node\: :ref:`Node<class_Node>`\ ) :ref:`🔗<class_SceneTree_signal_node_added>`
|
|
|
|
Emitida cuando el ``node`` entra en este árbol.
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _class_SceneTree_signal_node_configuration_warning_changed:
|
|
|
|
.. rst-class:: classref-signal
|
|
|
|
**node_configuration_warning_changed**\ (\ node\: :ref:`Node<class_Node>`\ ) :ref:`🔗<class_SceneTree_signal_node_configuration_warning_changed>`
|
|
|
|
Emitida al llamar a :ref:`Node.update_configuration_warnings()<class_Node_method_update_configuration_warnings>` de ``node``. Solo se emite en el editor.
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _class_SceneTree_signal_node_removed:
|
|
|
|
.. rst-class:: classref-signal
|
|
|
|
**node_removed**\ (\ node\: :ref:`Node<class_Node>`\ ) :ref:`🔗<class_SceneTree_signal_node_removed>`
|
|
|
|
Emitida cuando el ``node`` sale de este árbol.
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _class_SceneTree_signal_node_renamed:
|
|
|
|
.. rst-class:: classref-signal
|
|
|
|
**node_renamed**\ (\ node\: :ref:`Node<class_Node>`\ ) :ref:`🔗<class_SceneTree_signal_node_renamed>`
|
|
|
|
Emitida cuando el :ref:`Node.name<class_Node_property_name>` de ``node`` es cambiado.
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _class_SceneTree_signal_physics_frame:
|
|
|
|
.. rst-class:: classref-signal
|
|
|
|
**physics_frame**\ (\ ) :ref:`🔗<class_SceneTree_signal_physics_frame>`
|
|
|
|
Emitted immediately before :ref:`Node._physics_process()<class_Node_private_method__physics_process>` is called on every node in this tree.
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _class_SceneTree_signal_process_frame:
|
|
|
|
.. rst-class:: classref-signal
|
|
|
|
**process_frame**\ (\ ) :ref:`🔗<class_SceneTree_signal_process_frame>`
|
|
|
|
Emitted immediately before :ref:`Node._process()<class_Node_private_method__process>` is called on every node in this tree.
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _class_SceneTree_signal_scene_changed:
|
|
|
|
.. rst-class:: classref-signal
|
|
|
|
**scene_changed**\ (\ ) :ref:`🔗<class_SceneTree_signal_scene_changed>`
|
|
|
|
Emitida después de que la nueva escena se añade al árbol de escenas y se inicializa. Se puede usar para acceder de forma fiable a :ref:`current_scene<class_SceneTree_property_current_scene>` al cambiar de escena.
|
|
|
|
::
|
|
|
|
# Este código debería estar dentro de un autoload.
|
|
get_tree().change_scene_to_file(other_scene_path)
|
|
await get_tree().scene_changed
|
|
print(get_tree().current_scene) # Imprime la nueva escena.
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _class_SceneTree_signal_tree_changed:
|
|
|
|
.. rst-class:: classref-signal
|
|
|
|
**tree_changed**\ (\ ) :ref:`🔗<class_SceneTree_signal_tree_changed>`
|
|
|
|
Emitida cada vez que cambia la jerarquía del árbol (los nodos se mueven, se renombran, etc.).
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _class_SceneTree_signal_tree_process_mode_changed:
|
|
|
|
.. rst-class:: classref-signal
|
|
|
|
**tree_process_mode_changed**\ (\ ) :ref:`🔗<class_SceneTree_signal_tree_process_mode_changed>`
|
|
|
|
Emitida cuando cambia el :ref:`Node.process_mode<class_Node_property_process_mode>` de cualquier nodo dentro del árbol. Solo se emite en el editor, para actualizar la visibilidad de los nodos deshabilitados.
|
|
|
|
.. rst-class:: classref-section-separator
|
|
|
|
----
|
|
|
|
.. rst-class:: classref-descriptions-group
|
|
|
|
Enumeraciones
|
|
--------------------------
|
|
|
|
.. _enum_SceneTree_GroupCallFlags:
|
|
|
|
.. rst-class:: classref-enumeration
|
|
|
|
enum **GroupCallFlags**: :ref:`🔗<enum_SceneTree_GroupCallFlags>`
|
|
|
|
.. _class_SceneTree_constant_GROUP_CALL_DEFAULT:
|
|
|
|
.. rst-class:: classref-enumeration-constant
|
|
|
|
:ref:`GroupCallFlags<enum_SceneTree_GroupCallFlags>` **GROUP_CALL_DEFAULT** = ``0``
|
|
|
|
Call nodes within a group with no special behavior (default).
|
|
|
|
.. _class_SceneTree_constant_GROUP_CALL_REVERSE:
|
|
|
|
.. rst-class:: classref-enumeration-constant
|
|
|
|
:ref:`GroupCallFlags<enum_SceneTree_GroupCallFlags>` **GROUP_CALL_REVERSE** = ``1``
|
|
|
|
Llama a los nodos dentro de un grupo en orden jerárquico inverso al del árbol (todos los hijos anidados son llamados antes que sus respectivos nodos padres).
|
|
|
|
.. _class_SceneTree_constant_GROUP_CALL_DEFERRED:
|
|
|
|
.. rst-class:: classref-enumeration-constant
|
|
|
|
:ref:`GroupCallFlags<enum_SceneTree_GroupCallFlags>` **GROUP_CALL_DEFERRED** = ``2``
|
|
|
|
Call nodes within a group at the end of the current frame (can be either process or physics frame), similar to :ref:`Object.call_deferred()<class_Object_method_call_deferred>`.
|
|
|
|
.. _class_SceneTree_constant_GROUP_CALL_UNIQUE:
|
|
|
|
.. rst-class:: classref-enumeration-constant
|
|
|
|
:ref:`GroupCallFlags<enum_SceneTree_GroupCallFlags>` **GROUP_CALL_UNIQUE** = ``4``
|
|
|
|
Llama a los nodos dentro de un grupo una sola vez, incluso si la llamada se ejecuta muchas veces en el mismo fotograma. Debe combinarse con :ref:`GROUP_CALL_DEFERRED<class_SceneTree_constant_GROUP_CALL_DEFERRED>` para que funcione.
|
|
|
|
\ **Nota:** Los argumentos diferentes no se tienen en cuenta. Por lo tanto, cuando la misma llamada se ejecuta con diferentes argumentos, solo se realizará la primera llamada.
|
|
|
|
.. rst-class:: classref-section-separator
|
|
|
|
----
|
|
|
|
.. rst-class:: classref-descriptions-group
|
|
|
|
Descripciones de Propiedades
|
|
--------------------------------------------------------
|
|
|
|
.. _class_SceneTree_property_auto_accept_quit:
|
|
|
|
.. rst-class:: classref-property
|
|
|
|
:ref:`bool<class_bool>` **auto_accept_quit** = ``true`` :ref:`🔗<class_SceneTree_property_auto_accept_quit>`
|
|
|
|
.. rst-class:: classref-property-setget
|
|
|
|
- |void| **set_auto_accept_quit**\ (\ value\: :ref:`bool<class_bool>`\ )
|
|
- :ref:`bool<class_bool>` **is_auto_accept_quit**\ (\ )
|
|
|
|
If ``true``, the application automatically accepts quitting requests.
|
|
|
|
For mobile platforms, see :ref:`quit_on_go_back<class_SceneTree_property_quit_on_go_back>`.
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _class_SceneTree_property_current_scene:
|
|
|
|
.. rst-class:: classref-property
|
|
|
|
:ref:`Node<class_Node>` **current_scene** :ref:`🔗<class_SceneTree_property_current_scene>`
|
|
|
|
.. rst-class:: classref-property-setget
|
|
|
|
- |void| **set_current_scene**\ (\ value\: :ref:`Node<class_Node>`\ )
|
|
- :ref:`Node<class_Node>` **get_current_scene**\ (\ )
|
|
|
|
El nodo raíz de la escena principal cargada actualmente, normalmente como hijo directo de :ref:`root<class_SceneTree_property_root>`. Véase también :ref:`change_scene_to_file()<class_SceneTree_method_change_scene_to_file>`, :ref:`change_scene_to_packed()<class_SceneTree_method_change_scene_to_packed>`, y :ref:`reload_current_scene()<class_SceneTree_method_reload_current_scene>`.
|
|
|
|
\ **Advertencia:** Establecer esta propiedad directamente puede no funcionar como se espera, ya que *no* añade ni elimina ningún nodo de este árbol.
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _class_SceneTree_property_debug_collisions_hint:
|
|
|
|
.. rst-class:: classref-property
|
|
|
|
:ref:`bool<class_bool>` **debug_collisions_hint** = ``false`` :ref:`🔗<class_SceneTree_property_debug_collisions_hint>`
|
|
|
|
.. rst-class:: classref-property-setget
|
|
|
|
- |void| **set_debug_collisions_hint**\ (\ value\: :ref:`bool<class_bool>`\ )
|
|
- :ref:`bool<class_bool>` **is_debugging_collisions_hint**\ (\ )
|
|
|
|
Si es ``true``, las formas de colisión serán visibles al ejecutar el juego desde el editor con fines de depuración.
|
|
|
|
\ **Nota:** Esta propiedad no está diseñada para ser cambiada en tiempo de ejecución. Cambiar el valor de :ref:`debug_collisions_hint<class_SceneTree_property_debug_collisions_hint>` mientras el proyecto está en ejecución no tendrá el efecto deseado.
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _class_SceneTree_property_debug_navigation_hint:
|
|
|
|
.. rst-class:: classref-property
|
|
|
|
:ref:`bool<class_bool>` **debug_navigation_hint** = ``false`` :ref:`🔗<class_SceneTree_property_debug_navigation_hint>`
|
|
|
|
.. rst-class:: classref-property-setget
|
|
|
|
- |void| **set_debug_navigation_hint**\ (\ value\: :ref:`bool<class_bool>`\ )
|
|
- :ref:`bool<class_bool>` **is_debugging_navigation_hint**\ (\ )
|
|
|
|
Si es ``true``, los polígonos de navegación serán visibles al ejecutar el juego desde el editor con fines de depuración.
|
|
|
|
\ **Nota:** Esta propiedad no está diseñada para ser cambiada en tiempo de ejecución. Cambiar el valor de :ref:`debug_navigation_hint<class_SceneTree_property_debug_navigation_hint>` mientras el proyecto está en ejecución no tendrá el efecto deseado.
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _class_SceneTree_property_debug_paths_hint:
|
|
|
|
.. rst-class:: classref-property
|
|
|
|
:ref:`bool<class_bool>` **debug_paths_hint** = ``false`` :ref:`🔗<class_SceneTree_property_debug_paths_hint>`
|
|
|
|
.. rst-class:: classref-property-setget
|
|
|
|
- |void| **set_debug_paths_hint**\ (\ value\: :ref:`bool<class_bool>`\ )
|
|
- :ref:`bool<class_bool>` **is_debugging_paths_hint**\ (\ )
|
|
|
|
Si es ``true``, las curvas de los nodos :ref:`Path2D<class_Path2D>` y :ref:`Path3D<class_Path3D>` serán visibles al ejecutar el juego desde el editor con fines de depuración.
|
|
|
|
\ **Nota:** Esta propiedad no está diseñada para ser cambiada en tiempo de ejecución. Cambiar el valor de :ref:`debug_paths_hint<class_SceneTree_property_debug_paths_hint>` mientras el proyecto está en ejecución no tendrá el efecto deseado.
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _class_SceneTree_property_edited_scene_root:
|
|
|
|
.. rst-class:: classref-property
|
|
|
|
:ref:`Node<class_Node>` **edited_scene_root** :ref:`🔗<class_SceneTree_property_edited_scene_root>`
|
|
|
|
.. rst-class:: classref-property-setget
|
|
|
|
- |void| **set_edited_scene_root**\ (\ value\: :ref:`Node<class_Node>`\ )
|
|
- :ref:`Node<class_Node>` **get_edited_scene_root**\ (\ )
|
|
|
|
La raíz de la escena que se está editando actualmente en el editor. Suele ser un hijo directo de :ref:`root<class_SceneTree_property_root>`.
|
|
|
|
\ **Nota:** Esta propiedad no hace nada en las compilaciones de lanzamiento (release builds).
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _class_SceneTree_property_multiplayer_poll:
|
|
|
|
.. rst-class:: classref-property
|
|
|
|
:ref:`bool<class_bool>` **multiplayer_poll** = ``true`` :ref:`🔗<class_SceneTree_property_multiplayer_poll>`
|
|
|
|
.. rst-class:: classref-property-setget
|
|
|
|
- |void| **set_multiplayer_poll_enabled**\ (\ value\: :ref:`bool<class_bool>`\ )
|
|
- :ref:`bool<class_bool>` **is_multiplayer_poll_enabled**\ (\ )
|
|
|
|
If ``true`` (default value), enables automatic polling of the :ref:`MultiplayerAPI<class_MultiplayerAPI>` for this SceneTree during :ref:`process_frame<class_SceneTree_signal_process_frame>`.
|
|
|
|
If ``false``, you need to manually call :ref:`MultiplayerAPI.poll()<class_MultiplayerAPI_method_poll>` to process network packets and deliver RPCs. This allows running RPCs in a different loop (e.g. physics, thread, specific time step) and for manual :ref:`Mutex<class_Mutex>` protection when accessing the :ref:`MultiplayerAPI<class_MultiplayerAPI>` from threads.
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _class_SceneTree_property_paused:
|
|
|
|
.. rst-class:: classref-property
|
|
|
|
:ref:`bool<class_bool>` **paused** = ``false`` :ref:`🔗<class_SceneTree_property_paused>`
|
|
|
|
.. rst-class:: classref-property-setget
|
|
|
|
- |void| **set_pause**\ (\ value\: :ref:`bool<class_bool>`\ )
|
|
- :ref:`bool<class_bool>` **is_paused**\ (\ )
|
|
|
|
If ``true``, the scene tree is considered paused. This causes the following behavior:
|
|
|
|
- 2D and 3D physics will be stopped, as well as collision detection and related signals.
|
|
|
|
- Depending on each node's :ref:`Node.process_mode<class_Node_property_process_mode>`, their :ref:`Node._process()<class_Node_private_method__process>`, :ref:`Node._physics_process()<class_Node_private_method__physics_process>` and :ref:`Node._input()<class_Node_private_method__input>` callback methods may not called anymore.
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _class_SceneTree_property_physics_interpolation:
|
|
|
|
.. rst-class:: classref-property
|
|
|
|
:ref:`bool<class_bool>` **physics_interpolation** = ``false`` :ref:`🔗<class_SceneTree_property_physics_interpolation>`
|
|
|
|
.. rst-class:: classref-property-setget
|
|
|
|
- |void| **set_physics_interpolation_enabled**\ (\ value\: :ref:`bool<class_bool>`\ )
|
|
- :ref:`bool<class_bool>` **is_physics_interpolation_enabled**\ (\ )
|
|
|
|
If ``true``, the renderer will interpolate the transforms of objects (both physics and non-physics) between the last two transforms, so that smooth motion is seen even when physics ticks do not coincide with rendered frames.
|
|
|
|
The default value of this property is controlled by :ref:`ProjectSettings.physics/common/physics_interpolation<class_ProjectSettings_property_physics/common/physics_interpolation>`.
|
|
|
|
\ **Note:** Although this is a global setting, finer control of individual branches of the **SceneTree** is possible using :ref:`Node.physics_interpolation_mode<class_Node_property_physics_interpolation_mode>`.
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _class_SceneTree_property_quit_on_go_back:
|
|
|
|
.. rst-class:: classref-property
|
|
|
|
:ref:`bool<class_bool>` **quit_on_go_back** = ``true`` :ref:`🔗<class_SceneTree_property_quit_on_go_back>`
|
|
|
|
.. rst-class:: classref-property-setget
|
|
|
|
- |void| **set_quit_on_go_back**\ (\ value\: :ref:`bool<class_bool>`\ )
|
|
- :ref:`bool<class_bool>` **is_quit_on_go_back**\ (\ )
|
|
|
|
If ``true``, the application quits automatically when navigating back (e.g. using the system "Back" button on Android).
|
|
|
|
To handle 'Go Back' button when this option is disabled, use :ref:`DisplayServer.WINDOW_EVENT_GO_BACK_REQUEST<class_DisplayServer_constant_WINDOW_EVENT_GO_BACK_REQUEST>`.
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _class_SceneTree_property_root:
|
|
|
|
.. rst-class:: classref-property
|
|
|
|
:ref:`Window<class_Window>` **root** :ref:`🔗<class_SceneTree_property_root>`
|
|
|
|
.. rst-class:: classref-property-setget
|
|
|
|
- :ref:`Window<class_Window>` **get_root**\ (\ )
|
|
|
|
The tree's root :ref:`Window<class_Window>`. This is top-most :ref:`Node<class_Node>` of the scene tree, and is always present. An absolute :ref:`NodePath<class_NodePath>` always starts from this node. Children of the root node may include the loaded :ref:`current_scene<class_SceneTree_property_current_scene>`, as well as any :doc:`AutoLoad <../tutorials/scripting/singletons_autoload>` configured in the Project Settings.
|
|
|
|
\ **Warning:** Do not delete this node. This will result in unstable behavior, followed by a crash.
|
|
|
|
.. rst-class:: classref-section-separator
|
|
|
|
----
|
|
|
|
.. rst-class:: classref-descriptions-group
|
|
|
|
Descripciones de Métodos
|
|
------------------------------------------------
|
|
|
|
.. _class_SceneTree_method_call_group:
|
|
|
|
.. rst-class:: classref-method
|
|
|
|
|void| **call_group**\ (\ group\: :ref:`StringName<class_StringName>`, method\: :ref:`StringName<class_StringName>`, ...\ ) |vararg| :ref:`🔗<class_SceneTree_method_call_group>`
|
|
|
|
Calls ``method`` on each node inside this tree added to the given ``group``. You can pass arguments to ``method`` by specifying them at the end of this method call. Nodes that cannot call ``method`` (either because the method doesn't exist or the arguments do not match) are ignored. See also :ref:`set_group()<class_SceneTree_method_set_group>` and :ref:`notify_group()<class_SceneTree_method_notify_group>`.
|
|
|
|
\ **Note:** This method acts immediately on all selected nodes at once, which may cause stuttering in some performance-intensive situations.
|
|
|
|
\ **Note:** In C#, ``method`` must be in snake_case when referring to built-in Godot methods. Prefer using the names exposed in the ``MethodName`` class to avoid allocating a new :ref:`StringName<class_StringName>` on each call.
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _class_SceneTree_method_call_group_flags:
|
|
|
|
.. rst-class:: classref-method
|
|
|
|
|void| **call_group_flags**\ (\ flags\: :ref:`int<class_int>`, group\: :ref:`StringName<class_StringName>`, method\: :ref:`StringName<class_StringName>`, ...\ ) |vararg| :ref:`🔗<class_SceneTree_method_call_group_flags>`
|
|
|
|
Calls the given ``method`` on each node inside this tree added to the given ``group``. Use ``flags`` to customize this method's behavior (see :ref:`GroupCallFlags<enum_SceneTree_GroupCallFlags>`). Additional arguments for ``method`` can be passed at the end of this method. Nodes that cannot call ``method`` (either because the method doesn't exist or the arguments do not match) are ignored.
|
|
|
|
::
|
|
|
|
# Calls "hide" to all nodes of the "enemies" group, at the end of the frame and in reverse tree order.
|
|
get_tree().call_group_flags(
|
|
SceneTree.GROUP_CALL_DEFERRED | SceneTree.GROUP_CALL_REVERSE,
|
|
"enemies", "hide")
|
|
|
|
\ **Note:** In C#, ``method`` must be in snake_case when referring to built-in Godot methods. Prefer using the names exposed in the ``MethodName`` class to avoid allocating a new :ref:`StringName<class_StringName>` on each call.
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _class_SceneTree_method_change_scene_to_file:
|
|
|
|
.. rst-class:: classref-method
|
|
|
|
:ref:`Error<enum_@GlobalScope_Error>` **change_scene_to_file**\ (\ path\: :ref:`String<class_String>`\ ) :ref:`🔗<class_SceneTree_method_change_scene_to_file>`
|
|
|
|
Changes the running scene to the one at the given ``path``, after loading it into a :ref:`PackedScene<class_PackedScene>` and creating a new instance.
|
|
|
|
Returns :ref:`@GlobalScope.OK<class_@GlobalScope_constant_OK>` on success, :ref:`@GlobalScope.ERR_CANT_OPEN<class_@GlobalScope_constant_ERR_CANT_OPEN>` if the ``path`` cannot be loaded into a :ref:`PackedScene<class_PackedScene>`, or :ref:`@GlobalScope.ERR_CANT_CREATE<class_@GlobalScope_constant_ERR_CANT_CREATE>` if that scene cannot be instantiated.
|
|
|
|
\ **Note:** See :ref:`change_scene_to_node()<class_SceneTree_method_change_scene_to_node>` for details on the order of operations.
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _class_SceneTree_method_change_scene_to_node:
|
|
|
|
.. rst-class:: classref-method
|
|
|
|
:ref:`Error<enum_@GlobalScope_Error>` **change_scene_to_node**\ (\ node\: :ref:`Node<class_Node>`\ ) :ref:`🔗<class_SceneTree_method_change_scene_to_node>`
|
|
|
|
Changes the running scene to the provided :ref:`Node<class_Node>`. Useful when you want to set up the new scene before changing.
|
|
|
|
Returns :ref:`@GlobalScope.OK<class_@GlobalScope_constant_OK>` on success, :ref:`@GlobalScope.ERR_INVALID_PARAMETER<class_@GlobalScope_constant_ERR_INVALID_PARAMETER>` if the ``node`` is ``null``, or :ref:`@GlobalScope.ERR_UNCONFIGURED<class_@GlobalScope_constant_ERR_UNCONFIGURED>` if the ``node`` is already inside the scene tree.
|
|
|
|
\ **Note:** Operations happen in the following order when :ref:`change_scene_to_node()<class_SceneTree_method_change_scene_to_node>` is called:
|
|
|
|
1. The current scene node is immediately removed from the tree. From that point, :ref:`Node.get_tree()<class_Node_method_get_tree>` called on the current (outgoing) scene will return ``null``. :ref:`current_scene<class_SceneTree_property_current_scene>` will be ``null`` too, because the new scene is not available yet.
|
|
|
|
2. At the end of the frame, the formerly current scene, already removed from the tree, will be deleted (freed from memory) and then the new scene node will be added to the tree. :ref:`Node.get_tree()<class_Node_method_get_tree>` and :ref:`current_scene<class_SceneTree_property_current_scene>` will be back to working as usual.
|
|
|
|
This ensures that both scenes aren't running at the same time, while still freeing the previous scene in a safe way similar to :ref:`Node.queue_free()<class_Node_method_queue_free>`.
|
|
|
|
If you want to reliably access the new scene, await the :ref:`scene_changed<class_SceneTree_signal_scene_changed>` signal.
|
|
|
|
\ **Warning:** After using this method, the **SceneTree** will take ownership of the node and will free it automatically when changing scene again. Any references you had to that node will become invalid.
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _class_SceneTree_method_change_scene_to_packed:
|
|
|
|
.. rst-class:: classref-method
|
|
|
|
:ref:`Error<enum_@GlobalScope_Error>` **change_scene_to_packed**\ (\ packed_scene\: :ref:`PackedScene<class_PackedScene>`\ ) :ref:`🔗<class_SceneTree_method_change_scene_to_packed>`
|
|
|
|
Changes the running scene to a new instance of the given :ref:`PackedScene<class_PackedScene>` (which must be valid).
|
|
|
|
Returns :ref:`@GlobalScope.OK<class_@GlobalScope_constant_OK>` on success, :ref:`@GlobalScope.ERR_CANT_CREATE<class_@GlobalScope_constant_ERR_CANT_CREATE>` if the scene cannot be instantiated, or :ref:`@GlobalScope.ERR_INVALID_PARAMETER<class_@GlobalScope_constant_ERR_INVALID_PARAMETER>` if the scene is invalid.
|
|
|
|
\ **Note:** See :ref:`change_scene_to_node()<class_SceneTree_method_change_scene_to_node>` for details on the order of operations.
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _class_SceneTree_method_create_timer:
|
|
|
|
.. rst-class:: classref-method
|
|
|
|
:ref:`SceneTreeTimer<class_SceneTreeTimer>` **create_timer**\ (\ time_sec\: :ref:`float<class_float>`, process_always\: :ref:`bool<class_bool>` = true, process_in_physics\: :ref:`bool<class_bool>` = false, ignore_time_scale\: :ref:`bool<class_bool>` = false\ ) :ref:`🔗<class_SceneTree_method_create_timer>`
|
|
|
|
Returns a new :ref:`SceneTreeTimer<class_SceneTreeTimer>`. After ``time_sec`` in seconds have passed, the timer will emit :ref:`SceneTreeTimer.timeout<class_SceneTreeTimer_signal_timeout>` and will be automatically freed.
|
|
|
|
If ``process_always`` is ``false``, the timer will be paused when setting :ref:`paused<class_SceneTree_property_paused>` to ``true``.
|
|
|
|
If ``process_in_physics`` is ``true``, the timer will update at the end of the physics frame, instead of the process frame.
|
|
|
|
If ``ignore_time_scale`` is ``true``, the timer will ignore :ref:`Engine.time_scale<class_Engine_property_time_scale>` and update with the real, elapsed time.
|
|
|
|
This method is commonly used to create a one-shot delay timer, as in the following example:
|
|
|
|
|
|
.. tabs::
|
|
|
|
.. code-tab:: gdscript
|
|
|
|
func some_function():
|
|
print("start")
|
|
await get_tree().create_timer(1.0).timeout
|
|
print("end")
|
|
|
|
.. code-tab:: csharp
|
|
|
|
public async Task SomeFunction()
|
|
{
|
|
GD.Print("start");
|
|
await ToSignal(GetTree().CreateTimer(1.0f), SceneTreeTimer.SignalName.Timeout);
|
|
GD.Print("end");
|
|
}
|
|
|
|
|
|
|
|
\ **Note:** The timer is always updated *after* all of the nodes in the tree. A node's :ref:`Node._process()<class_Node_private_method__process>` method would be called before the timer updates (or :ref:`Node._physics_process()<class_Node_private_method__physics_process>` if ``process_in_physics`` is set to ``true``).
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _class_SceneTree_method_create_tween:
|
|
|
|
.. rst-class:: classref-method
|
|
|
|
:ref:`Tween<class_Tween>` **create_tween**\ (\ ) :ref:`🔗<class_SceneTree_method_create_tween>`
|
|
|
|
Creates and returns a new :ref:`Tween<class_Tween>` processed in this tree. The Tween will start automatically on the next process frame or physics frame (depending on its :ref:`TweenProcessMode<enum_Tween_TweenProcessMode>`).
|
|
|
|
\ **Note:** A :ref:`Tween<class_Tween>` created using this method is not bound to any :ref:`Node<class_Node>`. It may keep working until there is nothing left to animate. If you want the :ref:`Tween<class_Tween>` to be automatically killed when the :ref:`Node<class_Node>` is freed, use :ref:`Node.create_tween()<class_Node_method_create_tween>` or :ref:`Tween.bind_node()<class_Tween_method_bind_node>`.
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _class_SceneTree_method_get_first_node_in_group:
|
|
|
|
.. rst-class:: classref-method
|
|
|
|
:ref:`Node<class_Node>` **get_first_node_in_group**\ (\ group\: :ref:`StringName<class_StringName>`\ ) :ref:`🔗<class_SceneTree_method_get_first_node_in_group>`
|
|
|
|
Returns the first :ref:`Node<class_Node>` found inside the tree, that has been added to the given ``group``, in scene hierarchy order. Returns ``null`` if no match is found. See also :ref:`get_nodes_in_group()<class_SceneTree_method_get_nodes_in_group>`.
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _class_SceneTree_method_get_frame:
|
|
|
|
.. rst-class:: classref-method
|
|
|
|
:ref:`int<class_int>` **get_frame**\ (\ ) |const| :ref:`🔗<class_SceneTree_method_get_frame>`
|
|
|
|
Returns how many physics process steps have been processed, since the application started. This is *not* a measurement of elapsed time. See also :ref:`physics_frame<class_SceneTree_signal_physics_frame>`. For the number of frames rendered, see :ref:`Engine.get_process_frames()<class_Engine_method_get_process_frames>`.
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _class_SceneTree_method_get_multiplayer:
|
|
|
|
.. rst-class:: classref-method
|
|
|
|
:ref:`MultiplayerAPI<class_MultiplayerAPI>` **get_multiplayer**\ (\ for_path\: :ref:`NodePath<class_NodePath>` = NodePath("")\ ) |const| :ref:`🔗<class_SceneTree_method_get_multiplayer>`
|
|
|
|
Searches for the :ref:`MultiplayerAPI<class_MultiplayerAPI>` configured for the given path, if one does not exist it searches the parent paths until one is found. If the path is empty, or none is found, the default one is returned. See :ref:`set_multiplayer()<class_SceneTree_method_set_multiplayer>`.
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _class_SceneTree_method_get_node_count:
|
|
|
|
.. rst-class:: classref-method
|
|
|
|
:ref:`int<class_int>` **get_node_count**\ (\ ) |const| :ref:`🔗<class_SceneTree_method_get_node_count>`
|
|
|
|
Devuelve el número de nodos dentro de este árbol.
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _class_SceneTree_method_get_node_count_in_group:
|
|
|
|
.. rst-class:: classref-method
|
|
|
|
:ref:`int<class_int>` **get_node_count_in_group**\ (\ group\: :ref:`StringName<class_StringName>`\ ) |const| :ref:`🔗<class_SceneTree_method_get_node_count_in_group>`
|
|
|
|
Devuelve el número de nodos asignados al grupo dado.
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _class_SceneTree_method_get_nodes_in_group:
|
|
|
|
.. rst-class:: classref-method
|
|
|
|
:ref:`Array<class_Array>`\[:ref:`Node<class_Node>`\] **get_nodes_in_group**\ (\ group\: :ref:`StringName<class_StringName>`\ ) :ref:`🔗<class_SceneTree_method_get_nodes_in_group>`
|
|
|
|
Devuelve un :ref:`Array<class_Array>` que contiene todos los nodos dentro de este árbol, que han sido añadidos al ``group`` dado, en orden de jerarquía de escena.
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _class_SceneTree_method_get_processed_tweens:
|
|
|
|
.. rst-class:: classref-method
|
|
|
|
:ref:`Array<class_Array>`\[:ref:`Tween<class_Tween>`\] **get_processed_tweens**\ (\ ) :ref:`🔗<class_SceneTree_method_get_processed_tweens>`
|
|
|
|
Devuelve un :ref:`Array<class_Array>` de los :ref:`Tween<class_Tween>`\ s existentes en el árbol, incluyendo los tweens pausados.
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _class_SceneTree_method_has_group:
|
|
|
|
.. rst-class:: classref-method
|
|
|
|
:ref:`bool<class_bool>` **has_group**\ (\ name\: :ref:`StringName<class_StringName>`\ ) |const| :ref:`🔗<class_SceneTree_method_has_group>`
|
|
|
|
Devuelve ``true`` si un nodo añadido al grupo ``name`` dado existe en el árbol.
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _class_SceneTree_method_is_accessibility_enabled:
|
|
|
|
.. rst-class:: classref-method
|
|
|
|
:ref:`bool<class_bool>` **is_accessibility_enabled**\ (\ ) |const| :ref:`🔗<class_SceneTree_method_is_accessibility_enabled>`
|
|
|
|
Devuelve ``true`` si las características de accesibilidad están habilitadas, y las actualizaciones de información de accesibilidad se procesan activamente.
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _class_SceneTree_method_is_accessibility_supported:
|
|
|
|
.. rst-class:: classref-method
|
|
|
|
:ref:`bool<class_bool>` **is_accessibility_supported**\ (\ ) |const| :ref:`🔗<class_SceneTree_method_is_accessibility_supported>`
|
|
|
|
Devuelve ``true`` si las funciones de accesibilidad son compatibles con el sistema operativo y están habilitadas en la configuración del proyecto.
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _class_SceneTree_method_notify_group:
|
|
|
|
.. rst-class:: classref-method
|
|
|
|
|void| **notify_group**\ (\ group\: :ref:`StringName<class_StringName>`, notification\: :ref:`int<class_int>`\ ) :ref:`🔗<class_SceneTree_method_notify_group>`
|
|
|
|
Llama a :ref:`Object.notification()<class_Object_method_notification>` con la ``notification`` dada a todos los nodos dentro de este árbol añadidos al ``group``. Véase también :doc:`Notificaciones de Godot <../tutorials/best_practices/godot_notifications>` y :ref:`call_group()<class_SceneTree_method_call_group>` y :ref:`set_group()<class_SceneTree_method_set_group>`.
|
|
|
|
\ **Nota:** Este método actúa inmediatamente sobre todos los nodos seleccionados a la vez, lo que puede causar tartamudeo en algunas situaciones de rendimiento intensivo.
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _class_SceneTree_method_notify_group_flags:
|
|
|
|
.. rst-class:: classref-method
|
|
|
|
|void| **notify_group_flags**\ (\ call_flags\: :ref:`int<class_int>`, group\: :ref:`StringName<class_StringName>`, notification\: :ref:`int<class_int>`\ ) :ref:`🔗<class_SceneTree_method_notify_group_flags>`
|
|
|
|
Llama a :ref:`Object.notification()<class_Object_method_notification>` con la ``notification`` dada a todos los nodos dentro de este árbol añadidos al ``group``. Usa ``call_flags`` para personalizar el comportamiento de este método (véase :ref:`GroupCallFlags<enum_SceneTree_GroupCallFlags>`).
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _class_SceneTree_method_queue_delete:
|
|
|
|
.. rst-class:: classref-method
|
|
|
|
|void| **queue_delete**\ (\ obj\: :ref:`Object<class_Object>`\ ) :ref:`🔗<class_SceneTree_method_queue_delete>`
|
|
|
|
Pone en cola el ``obj`` dado para ser borrado, llamando a su :ref:`Object.free()<class_Object_method_free>` al final del fotograma actual. Este método es similar a :ref:`Node.queue_free()<class_Node_method_queue_free>`.
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _class_SceneTree_method_quit:
|
|
|
|
.. rst-class:: classref-method
|
|
|
|
|void| **quit**\ (\ exit_code\: :ref:`int<class_int>` = 0\ ) :ref:`🔗<class_SceneTree_method_quit>`
|
|
|
|
Quits the application at the end of the current iteration, with the given ``exit_code``.
|
|
|
|
By convention, an exit code of ``0`` indicates success, whereas any other exit code indicates an error. For portability reasons, it should be between ``0`` and ``125`` (inclusive).
|
|
|
|
\ **Note:** On iOS this method doesn't work. Instead, as recommended by the `iOS Human Interface Guidelines <https://developer.apple.com/library/archive/qa/qa1561/_index.html>`__, the user is expected to close apps via the Home button.
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _class_SceneTree_method_reload_current_scene:
|
|
|
|
.. rst-class:: classref-method
|
|
|
|
:ref:`Error<enum_@GlobalScope_Error>` **reload_current_scene**\ (\ ) :ref:`🔗<class_SceneTree_method_reload_current_scene>`
|
|
|
|
Reloads the currently active scene, replacing :ref:`current_scene<class_SceneTree_property_current_scene>` with a new instance of its original :ref:`PackedScene<class_PackedScene>`.
|
|
|
|
Returns :ref:`@GlobalScope.OK<class_@GlobalScope_constant_OK>` on success, :ref:`@GlobalScope.ERR_UNCONFIGURED<class_@GlobalScope_constant_ERR_UNCONFIGURED>` if no :ref:`current_scene<class_SceneTree_property_current_scene>` is defined, :ref:`@GlobalScope.ERR_CANT_OPEN<class_@GlobalScope_constant_ERR_CANT_OPEN>` if :ref:`current_scene<class_SceneTree_property_current_scene>` cannot be loaded into a :ref:`PackedScene<class_PackedScene>`, or :ref:`@GlobalScope.ERR_CANT_CREATE<class_@GlobalScope_constant_ERR_CANT_CREATE>` if the scene cannot be instantiated.
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _class_SceneTree_method_set_group:
|
|
|
|
.. rst-class:: classref-method
|
|
|
|
|void| **set_group**\ (\ group\: :ref:`StringName<class_StringName>`, property\: :ref:`String<class_String>`, value\: :ref:`Variant<class_Variant>`\ ) :ref:`🔗<class_SceneTree_method_set_group>`
|
|
|
|
Sets the given ``property`` to ``value`` on all nodes inside this tree added to the given ``group``. Nodes that do not have the ``property`` are ignored. See also :ref:`call_group()<class_SceneTree_method_call_group>` and :ref:`notify_group()<class_SceneTree_method_notify_group>`.
|
|
|
|
\ **Note:** This method acts immediately on all selected nodes at once, which may cause stuttering in some performance-intensive situations.
|
|
|
|
\ **Note:** In C#, ``property`` must be in snake_case when referring to built-in Godot properties. Prefer using the names exposed in the ``PropertyName`` class to avoid allocating a new :ref:`StringName<class_StringName>` on each call.
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _class_SceneTree_method_set_group_flags:
|
|
|
|
.. rst-class:: classref-method
|
|
|
|
|void| **set_group_flags**\ (\ call_flags\: :ref:`int<class_int>`, group\: :ref:`StringName<class_StringName>`, property\: :ref:`String<class_String>`, value\: :ref:`Variant<class_Variant>`\ ) :ref:`🔗<class_SceneTree_method_set_group_flags>`
|
|
|
|
Sets the given ``property`` to ``value`` on all nodes inside this tree added to the given ``group``. Nodes that do not have the ``property`` are ignored. Use ``call_flags`` to customize this method's behavior (see :ref:`GroupCallFlags<enum_SceneTree_GroupCallFlags>`).
|
|
|
|
\ **Note:** In C#, ``property`` must be in snake_case when referring to built-in Godot properties. Prefer using the names exposed in the ``PropertyName`` class to avoid allocating a new :ref:`StringName<class_StringName>` on each call.
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _class_SceneTree_method_set_multiplayer:
|
|
|
|
.. rst-class:: classref-method
|
|
|
|
|void| **set_multiplayer**\ (\ multiplayer\: :ref:`MultiplayerAPI<class_MultiplayerAPI>`, root_path\: :ref:`NodePath<class_NodePath>` = NodePath("")\ ) :ref:`🔗<class_SceneTree_method_set_multiplayer>`
|
|
|
|
Sets a custom :ref:`MultiplayerAPI<class_MultiplayerAPI>` with the given ``root_path`` (controlling also the relative subpaths), or override the default one if ``root_path`` is empty.
|
|
|
|
\ **Note:** No :ref:`MultiplayerAPI<class_MultiplayerAPI>` must be configured for the subpath containing ``root_path``, nested custom multiplayers are not allowed. I.e. if one is configured for ``"/root/Foo"`` setting one for ``"/root/Foo/Bar"`` will cause an error.
|
|
|
|
\ **Note:** :ref:`set_multiplayer()<class_SceneTree_method_set_multiplayer>` should be called *before* the child nodes are ready at the given ``root_path``. If multiplayer nodes like :ref:`MultiplayerSpawner<class_MultiplayerSpawner>` or :ref:`MultiplayerSynchronizer<class_MultiplayerSynchronizer>` are added to the tree before the custom multiplayer API is set, they will not work.
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _class_SceneTree_method_unload_current_scene:
|
|
|
|
.. rst-class:: classref-method
|
|
|
|
|void| **unload_current_scene**\ (\ ) :ref:`🔗<class_SceneTree_method_unload_current_scene>`
|
|
|
|
Si una escena actual está cargada, llamar a este método la descargará.
|
|
|
|
.. |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.)`
|