1090 lines
54 KiB
Text
1090 lines
54 KiB
Text
|
:github_url: hide
|
||
|
|
||
|
.. DO NOT EDIT THIS FILE!!!
|
||
|
.. Generated automatically from Godot engine sources.
|
||
|
.. Generator: https://github.com/godotengine/godot/tree/3.6/doc/tools/make_rst.py.
|
||
|
.. XML source: https://github.com/godotengine/godot/tree/3.6/doc/classes/SceneTree.xml.
|
||
|
|
||
|
.. _class_SceneTree:
|
||
|
|
||
|
SceneTree
|
||
|
=========
|
||
|
|
||
|
**Inherits:** :ref:`MainLoop<class_MainLoop>` **<** :ref:`Object<class_Object>`
|
||
|
|
||
|
Manages the game loop via a hierarchy of nodes.
|
||
|
|
||
|
.. rst-class:: classref-introduction-group
|
||
|
|
||
|
Description
|
||
|
-----------
|
||
|
|
||
|
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, retrieved 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 assigned 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 group's members at once.
|
||
|
|
||
|
\ **SceneTree** is the default :ref:`MainLoop<class_MainLoop>` implementation used by scenes, and is thus in charge of the game loop.
|
||
|
|
||
|
.. rst-class:: classref-introduction-group
|
||
|
|
||
|
Tutorials
|
||
|
---------
|
||
|
|
||
|
- :doc:`../tutorials/scripting/scene_tree`
|
||
|
|
||
|
- :doc:`../tutorials/rendering/multiple_resolutions`
|
||
|
|
||
|
.. rst-class:: classref-reftable-group
|
||
|
|
||
|
Properties
|
||
|
----------
|
||
|
|
||
|
.. 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:`Node<class_Node>` | :ref:`edited_scene_root<class_SceneTree_property_edited_scene_root>` | |
|
||
|
+-----------------------------------------------------------------+------------------------------------------------------------------------------------------------+-----------+
|
||
|
| :ref:`MultiplayerAPI<class_MultiplayerAPI>` | :ref:`multiplayer<class_SceneTree_property_multiplayer>` | |
|
||
|
+-----------------------------------------------------------------+------------------------------------------------------------------------------------------------+-----------+
|
||
|
| :ref:`bool<class_bool>` | :ref:`multiplayer_poll<class_SceneTree_property_multiplayer_poll>` | ``true`` |
|
||
|
+-----------------------------------------------------------------+------------------------------------------------------------------------------------------------+-----------+
|
||
|
| :ref:`NetworkedMultiplayerPeer<class_NetworkedMultiplayerPeer>` | :ref:`network_peer<class_SceneTree_property_network_peer>` | |
|
||
|
+-----------------------------------------------------------------+------------------------------------------------------------------------------------------------+-----------+
|
||
|
| :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:`bool<class_bool>` | :ref:`refuse_new_network_connections<class_SceneTree_property_refuse_new_network_connections>` | ``false`` |
|
||
|
+-----------------------------------------------------------------+------------------------------------------------------------------------------------------------+-----------+
|
||
|
| :ref:`Viewport<class_Viewport>` | :ref:`root<class_SceneTree_property_root>` | |
|
||
|
+-----------------------------------------------------------------+------------------------------------------------------------------------------------------------+-----------+
|
||
|
| :ref:`bool<class_bool>` | :ref:`use_font_oversampling<class_SceneTree_property_use_font_oversampling>` | ``false`` |
|
||
|
+-----------------------------------------------------------------+------------------------------------------------------------------------------------------------+-----------+
|
||
|
|
||
|
.. rst-class:: classref-reftable-group
|
||
|
|
||
|
Methods
|
||
|
-------
|
||
|
|
||
|
.. table::
|
||
|
:widths: auto
|
||
|
|
||
|
+---------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
|
| :ref:`Variant<class_Variant>` | :ref:`call_group<class_SceneTree_method_call_group>` **(** :ref:`String<class_String>` group, :ref:`String<class_String>` method, ... **)** |vararg| |
|
||
|
+---------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
|
| :ref:`Variant<class_Variant>` | :ref:`call_group_flags<class_SceneTree_method_call_group_flags>` **(** :ref:`int<class_int>` flags, :ref:`String<class_String>` group, :ref:`String<class_String>` method, ... **)** |vararg| |
|
||
|
+---------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
|
| :ref:`Error<enum_@GlobalScope_Error>` | :ref:`change_scene<class_SceneTree_method_change_scene>` **(** :ref:`String<class_String>` path **)** |
|
||
|
+---------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
|
| :ref:`Error<enum_@GlobalScope_Error>` | :ref:`change_scene_to<class_SceneTree_method_change_scene_to>` **(** :ref:`PackedScene<class_PackedScene>` packed_scene **)** |
|
||
|
+---------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
|
| :ref:`SceneTreeTimer<class_SceneTreeTimer>` | :ref:`create_timer<class_SceneTree_method_create_timer>` **(** :ref:`float<class_float>` time_sec, :ref:`bool<class_bool>` pause_mode_process=true **)** |
|
||
|
+---------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
|
| :ref:`SceneTreeTween<class_SceneTreeTween>` | :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>` **(** :ref:`String<class_String>` group **)** |
|
||
|
+---------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
|
| :ref:`int<class_int>` | :ref:`get_frame<class_SceneTree_method_get_frame>` **(** **)** |const| |
|
||
|
+---------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
|
| :ref:`PoolIntArray<class_PoolIntArray>` | :ref:`get_network_connected_peers<class_SceneTree_method_get_network_connected_peers>` **(** **)** |const| |
|
||
|
+---------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
|
| :ref:`int<class_int>` | :ref:`get_network_unique_id<class_SceneTree_method_get_network_unique_id>` **(** **)** |const| |
|
||
|
+---------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
|
| :ref:`int<class_int>` | :ref:`get_node_count<class_SceneTree_method_get_node_count>` **(** **)** |const| |
|
||
|
+---------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
|
| :ref:`Array<class_Array>` | :ref:`get_nodes_in_group<class_SceneTree_method_get_nodes_in_group>` **(** :ref:`String<class_String>` group **)** |
|
||
|
+---------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
|
| :ref:`Array<class_Array>` | :ref:`get_processed_tweens<class_SceneTree_method_get_processed_tweens>` **(** **)** |
|
||
|
+---------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
|
| :ref:`int<class_int>` | :ref:`get_rpc_sender_id<class_SceneTree_method_get_rpc_sender_id>` **(** **)** |const| |
|
||
|
+---------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
|
| :ref:`bool<class_bool>` | :ref:`has_group<class_SceneTree_method_has_group>` **(** :ref:`String<class_String>` name **)** |const| |
|
||
|
+---------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
|
| :ref:`bool<class_bool>` | :ref:`has_network_peer<class_SceneTree_method_has_network_peer>` **(** **)** |const| |
|
||
|
+---------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
|
| :ref:`bool<class_bool>` | :ref:`is_input_handled<class_SceneTree_method_is_input_handled>` **(** **)** |
|
||
|
+---------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
|
| :ref:`bool<class_bool>` | :ref:`is_network_server<class_SceneTree_method_is_network_server>` **(** **)** |const| |
|
||
|
+---------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
|
| void | :ref:`notify_group<class_SceneTree_method_notify_group>` **(** :ref:`String<class_String>` group, :ref:`int<class_int>` notification **)** |
|
||
|
+---------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
|
| void | :ref:`notify_group_flags<class_SceneTree_method_notify_group_flags>` **(** :ref:`int<class_int>` call_flags, :ref:`String<class_String>` group, :ref:`int<class_int>` notification **)** |
|
||
|
+---------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
|
| void | :ref:`queue_delete<class_SceneTree_method_queue_delete>` **(** :ref:`Object<class_Object>` obj **)** |
|
||
|
+---------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
|
| void | :ref:`quit<class_SceneTree_method_quit>` **(** :ref:`int<class_int>` exit_code=-1 **)** |
|
||
|
+---------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
|
| :ref:`Error<enum_@GlobalScope_Error>` | :ref:`reload_current_scene<class_SceneTree_method_reload_current_scene>` **(** **)** |
|
||
|
+---------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
|
| void | :ref:`set_group<class_SceneTree_method_set_group>` **(** :ref:`String<class_String>` group, :ref:`String<class_String>` property, :ref:`Variant<class_Variant>` value **)** |
|
||
|
+---------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
|
| void | :ref:`set_group_flags<class_SceneTree_method_set_group_flags>` **(** :ref:`int<class_int>` call_flags, :ref:`String<class_String>` group, :ref:`String<class_String>` property, :ref:`Variant<class_Variant>` value **)** |
|
||
|
+---------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
|
| void | :ref:`set_input_as_handled<class_SceneTree_method_set_input_as_handled>` **(** **)** |
|
||
|
+---------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
|
| void | :ref:`set_screen_stretch<class_SceneTree_method_set_screen_stretch>` **(** :ref:`StretchMode<enum_SceneTree_StretchMode>` mode, :ref:`StretchAspect<enum_SceneTree_StretchAspect>` aspect, :ref:`Vector2<class_Vector2>` minsize, :ref:`float<class_float>` scale=1 **)** |
|
||
|
+---------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
|
|
||
|
.. rst-class:: classref-section-separator
|
||
|
|
||
|
----
|
||
|
|
||
|
.. rst-class:: classref-descriptions-group
|
||
|
|
||
|
Signals
|
||
|
-------
|
||
|
|
||
|
.. _class_SceneTree_signal_connected_to_server:
|
||
|
|
||
|
.. rst-class:: classref-signal
|
||
|
|
||
|
**connected_to_server** **(** **)**
|
||
|
|
||
|
Emitted whenever this **SceneTree**'s :ref:`network_peer<class_SceneTree_property_network_peer>` successfully connected to a server. Only emitted on clients.
|
||
|
|
||
|
.. rst-class:: classref-item-separator
|
||
|
|
||
|
----
|
||
|
|
||
|
.. _class_SceneTree_signal_connection_failed:
|
||
|
|
||
|
.. rst-class:: classref-signal
|
||
|
|
||
|
**connection_failed** **(** **)**
|
||
|
|
||
|
Emitted whenever this **SceneTree**'s :ref:`network_peer<class_SceneTree_property_network_peer>` fails to establish a connection to a server. Only emitted on clients.
|
||
|
|
||
|
.. rst-class:: classref-item-separator
|
||
|
|
||
|
----
|
||
|
|
||
|
.. _class_SceneTree_signal_files_dropped:
|
||
|
|
||
|
.. rst-class:: classref-signal
|
||
|
|
||
|
**files_dropped** **(** :ref:`PoolStringArray<class_PoolStringArray>` files, :ref:`int<class_int>` screen **)**
|
||
|
|
||
|
Emitted when files are dragged from the OS file manager and dropped in the game window. The arguments are a list of file paths and the identifier of the screen where the drag originated.
|
||
|
|
||
|
.. rst-class:: classref-item-separator
|
||
|
|
||
|
----
|
||
|
|
||
|
.. _class_SceneTree_signal_global_menu_action:
|
||
|
|
||
|
.. rst-class:: classref-signal
|
||
|
|
||
|
**global_menu_action** **(** :ref:`Variant<class_Variant>` id, :ref:`Variant<class_Variant>` meta **)**
|
||
|
|
||
|
Emitted whenever global menu item is clicked.
|
||
|
|
||
|
.. rst-class:: classref-item-separator
|
||
|
|
||
|
----
|
||
|
|
||
|
.. _class_SceneTree_signal_idle_frame:
|
||
|
|
||
|
.. rst-class:: classref-signal
|
||
|
|
||
|
**idle_frame** **(** **)**
|
||
|
|
||
|
Emitted immediately before :ref:`Node._process<class_Node_method__process>` is called on every node in the **SceneTree**.
|
||
|
|
||
|
.. rst-class:: classref-item-separator
|
||
|
|
||
|
----
|
||
|
|
||
|
.. _class_SceneTree_signal_network_peer_connected:
|
||
|
|
||
|
.. rst-class:: classref-signal
|
||
|
|
||
|
**network_peer_connected** **(** :ref:`int<class_int>` id **)**
|
||
|
|
||
|
Emitted whenever this **SceneTree**'s :ref:`network_peer<class_SceneTree_property_network_peer>` connects with a new peer. ID is the peer ID of the new peer. Clients get notified when other clients connect to the same server. Upon connecting to a server, a client also receives this signal for the server (with ID being 1).
|
||
|
|
||
|
.. rst-class:: classref-item-separator
|
||
|
|
||
|
----
|
||
|
|
||
|
.. _class_SceneTree_signal_network_peer_disconnected:
|
||
|
|
||
|
.. rst-class:: classref-signal
|
||
|
|
||
|
**network_peer_disconnected** **(** :ref:`int<class_int>` id **)**
|
||
|
|
||
|
Emitted whenever this **SceneTree**'s :ref:`network_peer<class_SceneTree_property_network_peer>` disconnects from a peer. Clients get notified when other clients disconnect from the same server.
|
||
|
|
||
|
.. rst-class:: classref-item-separator
|
||
|
|
||
|
----
|
||
|
|
||
|
.. _class_SceneTree_signal_node_added:
|
||
|
|
||
|
.. rst-class:: classref-signal
|
||
|
|
||
|
**node_added** **(** :ref:`Node<class_Node>` node **)**
|
||
|
|
||
|
Emitted whenever a node is added to the **SceneTree**.
|
||
|
|
||
|
.. rst-class:: classref-item-separator
|
||
|
|
||
|
----
|
||
|
|
||
|
.. _class_SceneTree_signal_node_configuration_warning_changed:
|
||
|
|
||
|
.. rst-class:: classref-signal
|
||
|
|
||
|
**node_configuration_warning_changed** **(** :ref:`Node<class_Node>` node **)**
|
||
|
|
||
|
Emitted when a node's configuration changed. Only emitted in ``tool`` mode.
|
||
|
|
||
|
.. rst-class:: classref-item-separator
|
||
|
|
||
|
----
|
||
|
|
||
|
.. _class_SceneTree_signal_node_removed:
|
||
|
|
||
|
.. rst-class:: classref-signal
|
||
|
|
||
|
**node_removed** **(** :ref:`Node<class_Node>` node **)**
|
||
|
|
||
|
Emitted whenever a node is removed from the **SceneTree**.
|
||
|
|
||
|
.. rst-class:: classref-item-separator
|
||
|
|
||
|
----
|
||
|
|
||
|
.. _class_SceneTree_signal_node_renamed:
|
||
|
|
||
|
.. rst-class:: classref-signal
|
||
|
|
||
|
**node_renamed** **(** :ref:`Node<class_Node>` node **)**
|
||
|
|
||
|
Emitted whenever a node is renamed.
|
||
|
|
||
|
.. rst-class:: classref-item-separator
|
||
|
|
||
|
----
|
||
|
|
||
|
.. _class_SceneTree_signal_physics_frame:
|
||
|
|
||
|
.. rst-class:: classref-signal
|
||
|
|
||
|
**physics_frame** **(** **)**
|
||
|
|
||
|
Emitted immediately before :ref:`Node._physics_process<class_Node_method__physics_process>` is called on every node in the **SceneTree**.
|
||
|
|
||
|
.. rst-class:: classref-item-separator
|
||
|
|
||
|
----
|
||
|
|
||
|
.. _class_SceneTree_signal_screen_resized:
|
||
|
|
||
|
.. rst-class:: classref-signal
|
||
|
|
||
|
**screen_resized** **(** **)**
|
||
|
|
||
|
Emitted when the screen resolution (fullscreen) or window size (windowed) changes.
|
||
|
|
||
|
.. rst-class:: classref-item-separator
|
||
|
|
||
|
----
|
||
|
|
||
|
.. _class_SceneTree_signal_server_disconnected:
|
||
|
|
||
|
.. rst-class:: classref-signal
|
||
|
|
||
|
**server_disconnected** **(** **)**
|
||
|
|
||
|
Emitted whenever this **SceneTree**'s :ref:`network_peer<class_SceneTree_property_network_peer>` disconnected from server. Only emitted on clients.
|
||
|
|
||
|
.. rst-class:: classref-item-separator
|
||
|
|
||
|
----
|
||
|
|
||
|
.. _class_SceneTree_signal_tree_changed:
|
||
|
|
||
|
.. rst-class:: classref-signal
|
||
|
|
||
|
**tree_changed** **(** **)**
|
||
|
|
||
|
Emitted whenever the **SceneTree** hierarchy changed (children being moved or renamed, etc.).
|
||
|
|
||
|
.. rst-class:: classref-section-separator
|
||
|
|
||
|
----
|
||
|
|
||
|
.. rst-class:: classref-descriptions-group
|
||
|
|
||
|
Enumerations
|
||
|
------------
|
||
|
|
||
|
.. _enum_SceneTree_GroupCallFlags:
|
||
|
|
||
|
.. rst-class:: classref-enumeration
|
||
|
|
||
|
enum **GroupCallFlags**:
|
||
|
|
||
|
.. _class_SceneTree_constant_GROUP_CALL_DEFAULT:
|
||
|
|
||
|
.. rst-class:: classref-enumeration-constant
|
||
|
|
||
|
:ref:`GroupCallFlags<enum_SceneTree_GroupCallFlags>` **GROUP_CALL_DEFAULT** = ``0``
|
||
|
|
||
|
Call a group with no flags (default).
|
||
|
|
||
|
.. _class_SceneTree_constant_GROUP_CALL_REVERSE:
|
||
|
|
||
|
.. rst-class:: classref-enumeration-constant
|
||
|
|
||
|
:ref:`GroupCallFlags<enum_SceneTree_GroupCallFlags>` **GROUP_CALL_REVERSE** = ``1``
|
||
|
|
||
|
Call a group in reverse scene order.
|
||
|
|
||
|
.. _class_SceneTree_constant_GROUP_CALL_REALTIME:
|
||
|
|
||
|
.. rst-class:: classref-enumeration-constant
|
||
|
|
||
|
:ref:`GroupCallFlags<enum_SceneTree_GroupCallFlags>` **GROUP_CALL_REALTIME** = ``2``
|
||
|
|
||
|
Call a group immediately (calls are normally made on idle).
|
||
|
|
||
|
.. _class_SceneTree_constant_GROUP_CALL_UNIQUE:
|
||
|
|
||
|
.. rst-class:: classref-enumeration-constant
|
||
|
|
||
|
:ref:`GroupCallFlags<enum_SceneTree_GroupCallFlags>` **GROUP_CALL_UNIQUE** = ``4``
|
||
|
|
||
|
Call a group only once even if the call is executed many times.
|
||
|
|
||
|
\ **Note:** Arguments are not taken into account when deciding whether the call is unique or not. Therefore when the same method is called with different arguments, only the first call will be performed.
|
||
|
|
||
|
.. rst-class:: classref-item-separator
|
||
|
|
||
|
----
|
||
|
|
||
|
.. _enum_SceneTree_StretchMode:
|
||
|
|
||
|
.. rst-class:: classref-enumeration
|
||
|
|
||
|
enum **StretchMode**:
|
||
|
|
||
|
.. _class_SceneTree_constant_STRETCH_MODE_DISABLED:
|
||
|
|
||
|
.. rst-class:: classref-enumeration-constant
|
||
|
|
||
|
:ref:`StretchMode<enum_SceneTree_StretchMode>` **STRETCH_MODE_DISABLED** = ``0``
|
||
|
|
||
|
No stretching.
|
||
|
|
||
|
.. _class_SceneTree_constant_STRETCH_MODE_2D:
|
||
|
|
||
|
.. rst-class:: classref-enumeration-constant
|
||
|
|
||
|
:ref:`StretchMode<enum_SceneTree_StretchMode>` **STRETCH_MODE_2D** = ``1``
|
||
|
|
||
|
Render stretching in higher resolution (interpolated).
|
||
|
|
||
|
.. _class_SceneTree_constant_STRETCH_MODE_VIEWPORT:
|
||
|
|
||
|
.. rst-class:: classref-enumeration-constant
|
||
|
|
||
|
:ref:`StretchMode<enum_SceneTree_StretchMode>` **STRETCH_MODE_VIEWPORT** = ``2``
|
||
|
|
||
|
Keep the specified display resolution. No interpolation. Content may appear pixelated.
|
||
|
|
||
|
.. rst-class:: classref-item-separator
|
||
|
|
||
|
----
|
||
|
|
||
|
.. _enum_SceneTree_StretchAspect:
|
||
|
|
||
|
.. rst-class:: classref-enumeration
|
||
|
|
||
|
enum **StretchAspect**:
|
||
|
|
||
|
.. _class_SceneTree_constant_STRETCH_ASPECT_IGNORE:
|
||
|
|
||
|
.. rst-class:: classref-enumeration-constant
|
||
|
|
||
|
:ref:`StretchAspect<enum_SceneTree_StretchAspect>` **STRETCH_ASPECT_IGNORE** = ``0``
|
||
|
|
||
|
Fill the window with the content stretched to cover excessive space. Content may appear stretched.
|
||
|
|
||
|
.. _class_SceneTree_constant_STRETCH_ASPECT_KEEP:
|
||
|
|
||
|
.. rst-class:: classref-enumeration-constant
|
||
|
|
||
|
:ref:`StretchAspect<enum_SceneTree_StretchAspect>` **STRETCH_ASPECT_KEEP** = ``1``
|
||
|
|
||
|
Retain the same aspect ratio by padding with black bars on either axis. This prevents distortion.
|
||
|
|
||
|
.. _class_SceneTree_constant_STRETCH_ASPECT_KEEP_WIDTH:
|
||
|
|
||
|
.. rst-class:: classref-enumeration-constant
|
||
|
|
||
|
:ref:`StretchAspect<enum_SceneTree_StretchAspect>` **STRETCH_ASPECT_KEEP_WIDTH** = ``2``
|
||
|
|
||
|
Expand vertically. Left/right black bars may appear if the window is too wide.
|
||
|
|
||
|
.. _class_SceneTree_constant_STRETCH_ASPECT_KEEP_HEIGHT:
|
||
|
|
||
|
.. rst-class:: classref-enumeration-constant
|
||
|
|
||
|
:ref:`StretchAspect<enum_SceneTree_StretchAspect>` **STRETCH_ASPECT_KEEP_HEIGHT** = ``3``
|
||
|
|
||
|
Expand horizontally. Top/bottom black bars may appear if the window is too tall.
|
||
|
|
||
|
.. _class_SceneTree_constant_STRETCH_ASPECT_EXPAND:
|
||
|
|
||
|
.. rst-class:: classref-enumeration-constant
|
||
|
|
||
|
:ref:`StretchAspect<enum_SceneTree_StretchAspect>` **STRETCH_ASPECT_EXPAND** = ``4``
|
||
|
|
||
|
Expand in both directions, retaining the same aspect ratio. This prevents distortion while avoiding black bars.
|
||
|
|
||
|
.. rst-class:: classref-section-separator
|
||
|
|
||
|
----
|
||
|
|
||
|
.. rst-class:: classref-descriptions-group
|
||
|
|
||
|
Property Descriptions
|
||
|
---------------------
|
||
|
|
||
|
.. _class_SceneTree_property_auto_accept_quit:
|
||
|
|
||
|
.. rst-class:: classref-property
|
||
|
|
||
|
:ref:`bool<class_bool>` **auto_accept_quit** = ``true``
|
||
|
|
||
|
.. rst-class:: classref-property-setget
|
||
|
|
||
|
- void **set_auto_accept_quit** **(** :ref:`bool<class_bool>` value **)**
|
||
|
- :ref:`bool<class_bool>` **is_auto_accept_quit** **(** **)**
|
||
|
|
||
|
If ``true``, the application automatically accepts quitting.
|
||
|
|
||
|
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**
|
||
|
|
||
|
.. rst-class:: classref-property-setget
|
||
|
|
||
|
- void **set_current_scene** **(** :ref:`Node<class_Node>` value **)**
|
||
|
- :ref:`Node<class_Node>` **get_current_scene** **(** **)**
|
||
|
|
||
|
The current scene.
|
||
|
|
||
|
.. rst-class:: classref-item-separator
|
||
|
|
||
|
----
|
||
|
|
||
|
.. _class_SceneTree_property_debug_collisions_hint:
|
||
|
|
||
|
.. rst-class:: classref-property
|
||
|
|
||
|
:ref:`bool<class_bool>` **debug_collisions_hint** = ``false``
|
||
|
|
||
|
.. rst-class:: classref-property-setget
|
||
|
|
||
|
- void **set_debug_collisions_hint** **(** :ref:`bool<class_bool>` value **)**
|
||
|
- :ref:`bool<class_bool>` **is_debugging_collisions_hint** **(** **)**
|
||
|
|
||
|
If ``true``, collision shapes will be visible when running the game from the editor for debugging purposes.
|
||
|
|
||
|
\ **Note:** This property is not designed to be changed at run-time. Changing the value of :ref:`debug_collisions_hint<class_SceneTree_property_debug_collisions_hint>` while the project is running will not have the desired effect.
|
||
|
|
||
|
.. rst-class:: classref-item-separator
|
||
|
|
||
|
----
|
||
|
|
||
|
.. _class_SceneTree_property_debug_navigation_hint:
|
||
|
|
||
|
.. rst-class:: classref-property
|
||
|
|
||
|
:ref:`bool<class_bool>` **debug_navigation_hint** = ``false``
|
||
|
|
||
|
.. rst-class:: classref-property-setget
|
||
|
|
||
|
- void **set_debug_navigation_hint** **(** :ref:`bool<class_bool>` value **)**
|
||
|
- :ref:`bool<class_bool>` **is_debugging_navigation_hint** **(** **)**
|
||
|
|
||
|
If ``true``, navigation polygons will be visible when running the game from the editor for debugging purposes.
|
||
|
|
||
|
\ **Note:** This property is not designed to be changed at run-time. Changing the value of :ref:`debug_navigation_hint<class_SceneTree_property_debug_navigation_hint>` while the project is running will not have the desired effect.
|
||
|
|
||
|
.. rst-class:: classref-item-separator
|
||
|
|
||
|
----
|
||
|
|
||
|
.. _class_SceneTree_property_edited_scene_root:
|
||
|
|
||
|
.. rst-class:: classref-property
|
||
|
|
||
|
:ref:`Node<class_Node>` **edited_scene_root**
|
||
|
|
||
|
.. rst-class:: classref-property-setget
|
||
|
|
||
|
- void **set_edited_scene_root** **(** :ref:`Node<class_Node>` value **)**
|
||
|
- :ref:`Node<class_Node>` **get_edited_scene_root** **(** **)**
|
||
|
|
||
|
The root of the edited scene.
|
||
|
|
||
|
.. rst-class:: classref-item-separator
|
||
|
|
||
|
----
|
||
|
|
||
|
.. _class_SceneTree_property_multiplayer:
|
||
|
|
||
|
.. rst-class:: classref-property
|
||
|
|
||
|
:ref:`MultiplayerAPI<class_MultiplayerAPI>` **multiplayer**
|
||
|
|
||
|
.. rst-class:: classref-property-setget
|
||
|
|
||
|
- void **set_multiplayer** **(** :ref:`MultiplayerAPI<class_MultiplayerAPI>` value **)**
|
||
|
- :ref:`MultiplayerAPI<class_MultiplayerAPI>` **get_multiplayer** **(** **)**
|
||
|
|
||
|
The default :ref:`MultiplayerAPI<class_MultiplayerAPI>` instance for this **SceneTree**.
|
||
|
|
||
|
.. rst-class:: classref-item-separator
|
||
|
|
||
|
----
|
||
|
|
||
|
.. _class_SceneTree_property_multiplayer_poll:
|
||
|
|
||
|
.. rst-class:: classref-property
|
||
|
|
||
|
:ref:`bool<class_bool>` **multiplayer_poll** = ``true``
|
||
|
|
||
|
.. rst-class:: classref-property-setget
|
||
|
|
||
|
- void **set_multiplayer_poll_enabled** **(** :ref:`bool<class_bool>` value **)**
|
||
|
- :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:`idle_frame<class_SceneTree_signal_idle_frame>`.
|
||
|
|
||
|
If ``false``, you need to manually call :ref:`MultiplayerAPI.poll<class_MultiplayerAPI_method_poll>` to process network packets and deliver RPCs/RSETs. This allows running RPCs/RSETs 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_network_peer:
|
||
|
|
||
|
.. rst-class:: classref-property
|
||
|
|
||
|
:ref:`NetworkedMultiplayerPeer<class_NetworkedMultiplayerPeer>` **network_peer**
|
||
|
|
||
|
.. rst-class:: classref-property-setget
|
||
|
|
||
|
- void **set_network_peer** **(** :ref:`NetworkedMultiplayerPeer<class_NetworkedMultiplayerPeer>` value **)**
|
||
|
- :ref:`NetworkedMultiplayerPeer<class_NetworkedMultiplayerPeer>` **get_network_peer** **(** **)**
|
||
|
|
||
|
The peer object to handle the RPC system (effectively enabling networking when set). Depending on the peer itself, the **SceneTree** will become a network server (check with :ref:`is_network_server<class_SceneTree_method_is_network_server>`) and will set the root node's network mode to master, or it will become a regular peer with the root node set to puppet. All child nodes are set to inherit the network mode by default. Handling of networking-related events (connection, disconnection, new clients) is done by connecting to **SceneTree**'s signals.
|
||
|
|
||
|
.. rst-class:: classref-item-separator
|
||
|
|
||
|
----
|
||
|
|
||
|
.. _class_SceneTree_property_paused:
|
||
|
|
||
|
.. rst-class:: classref-property
|
||
|
|
||
|
:ref:`bool<class_bool>` **paused** = ``false``
|
||
|
|
||
|
.. rst-class:: classref-property-setget
|
||
|
|
||
|
- void **set_pause** **(** :ref:`bool<class_bool>` value **)**
|
||
|
- :ref:`bool<class_bool>` **is_paused** **(** **)**
|
||
|
|
||
|
If ``true``, the **SceneTree** is paused. Doing so will have the following behavior:
|
||
|
|
||
|
- 2D and 3D physics will be stopped. This includes signals and collision detection.
|
||
|
|
||
|
- :ref:`Node._process<class_Node_method__process>`, :ref:`Node._physics_process<class_Node_method__physics_process>` and :ref:`Node._input<class_Node_method__input>` will not be called anymore in nodes.
|
||
|
|
||
|
.. rst-class:: classref-item-separator
|
||
|
|
||
|
----
|
||
|
|
||
|
.. _class_SceneTree_property_physics_interpolation:
|
||
|
|
||
|
.. rst-class:: classref-property
|
||
|
|
||
|
:ref:`bool<class_bool>` **physics_interpolation** = ``false``
|
||
|
|
||
|
.. rst-class:: classref-property-setget
|
||
|
|
||
|
- void **set_physics_interpolation_enabled** **(** :ref:`bool<class_bool>` value **)**
|
||
|
- :ref:`bool<class_bool>` **is_physics_interpolation_enabled** **(** **)**
|
||
|
|
||
|
Although physics interpolation would normally be globally turned on and off using :ref:`ProjectSettings.physics/common/physics_interpolation<class_ProjectSettings_property_physics/common/physics_interpolation>`, this property allows control over interpolation at runtime.
|
||
|
|
||
|
.. 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``
|
||
|
|
||
|
.. rst-class:: classref-property-setget
|
||
|
|
||
|
- void **set_quit_on_go_back** **(** :ref:`bool<class_bool>` value **)**
|
||
|
- :ref:`bool<class_bool>` **is_quit_on_go_back** **(** **)**
|
||
|
|
||
|
If ``true``, the application quits automatically on going back (e.g. on Android).
|
||
|
|
||
|
To handle 'Go Back' button when this option is disabled, use :ref:`MainLoop.NOTIFICATION_WM_GO_BACK_REQUEST<class_MainLoop_constant_NOTIFICATION_WM_GO_BACK_REQUEST>`.
|
||
|
|
||
|
.. rst-class:: classref-item-separator
|
||
|
|
||
|
----
|
||
|
|
||
|
.. _class_SceneTree_property_refuse_new_network_connections:
|
||
|
|
||
|
.. rst-class:: classref-property
|
||
|
|
||
|
:ref:`bool<class_bool>` **refuse_new_network_connections** = ``false``
|
||
|
|
||
|
.. rst-class:: classref-property-setget
|
||
|
|
||
|
- void **set_refuse_new_network_connections** **(** :ref:`bool<class_bool>` value **)**
|
||
|
- :ref:`bool<class_bool>` **is_refusing_new_network_connections** **(** **)**
|
||
|
|
||
|
If ``true``, the **SceneTree**'s :ref:`network_peer<class_SceneTree_property_network_peer>` refuses new incoming connections.
|
||
|
|
||
|
.. rst-class:: classref-item-separator
|
||
|
|
||
|
----
|
||
|
|
||
|
.. _class_SceneTree_property_root:
|
||
|
|
||
|
.. rst-class:: classref-property
|
||
|
|
||
|
:ref:`Viewport<class_Viewport>` **root**
|
||
|
|
||
|
.. rst-class:: classref-property-setget
|
||
|
|
||
|
- :ref:`Viewport<class_Viewport>` **get_root** **(** **)**
|
||
|
|
||
|
The **SceneTree**'s root :ref:`Viewport<class_Viewport>`.
|
||
|
|
||
|
.. rst-class:: classref-item-separator
|
||
|
|
||
|
----
|
||
|
|
||
|
.. _class_SceneTree_property_use_font_oversampling:
|
||
|
|
||
|
.. rst-class:: classref-property
|
||
|
|
||
|
:ref:`bool<class_bool>` **use_font_oversampling** = ``false``
|
||
|
|
||
|
.. rst-class:: classref-property-setget
|
||
|
|
||
|
- void **set_use_font_oversampling** **(** :ref:`bool<class_bool>` value **)**
|
||
|
- :ref:`bool<class_bool>` **is_using_font_oversampling** **(** **)**
|
||
|
|
||
|
If ``true``, font oversampling is enabled. This means that :ref:`DynamicFont<class_DynamicFont>`\ s will be rendered at higher or lower size than configured based on the viewport's scaling ratio. For example, in a viewport scaled with a factor 1.5, a font configured with size 14 would be rendered with size 21 (``14 * 1.5``).
|
||
|
|
||
|
\ **Note:** Font oversampling is only used if the viewport stretch mode is :ref:`STRETCH_MODE_VIEWPORT<class_SceneTree_constant_STRETCH_MODE_VIEWPORT>`, and if the stretch aspect mode is different from :ref:`STRETCH_ASPECT_IGNORE<class_SceneTree_constant_STRETCH_ASPECT_IGNORE>`.
|
||
|
|
||
|
\ **Note:** This property is set automatically for the active **SceneTree** when the project starts based on the configuration of ``rendering/quality/dynamic_fonts/use_oversampling`` in :ref:`ProjectSettings<class_ProjectSettings>`. The property can however be overridden at runtime as needed.
|
||
|
|
||
|
.. rst-class:: classref-section-separator
|
||
|
|
||
|
----
|
||
|
|
||
|
.. rst-class:: classref-descriptions-group
|
||
|
|
||
|
Method Descriptions
|
||
|
-------------------
|
||
|
|
||
|
.. _class_SceneTree_method_call_group:
|
||
|
|
||
|
.. rst-class:: classref-method
|
||
|
|
||
|
:ref:`Variant<class_Variant>` **call_group** **(** :ref:`String<class_String>` group, :ref:`String<class_String>` method, ... **)** |vararg|
|
||
|
|
||
|
Calls ``method`` on each member of the given group. You can pass arguments to ``method`` by specifying them at the end of the method call. This method is equivalent of calling :ref:`call_group_flags<class_SceneTree_method_call_group_flags>` with :ref:`GROUP_CALL_DEFAULT<class_SceneTree_constant_GROUP_CALL_DEFAULT>` flag.
|
||
|
|
||
|
\ **Note:** ``method`` may only have 5 arguments at most (7 arguments passed to this method in total).
|
||
|
|
||
|
\ **Note:** Due to design limitations, :ref:`call_group<class_SceneTree_method_call_group>` will fail silently if one of the arguments is ``null``.
|
||
|
|
||
|
\ **Note:** :ref:`call_group<class_SceneTree_method_call_group>` will always call methods with an one-frame delay, in a way similar to :ref:`Object.call_deferred<class_Object_method_call_deferred>`. To call methods immediately, use :ref:`call_group_flags<class_SceneTree_method_call_group_flags>` with the :ref:`GROUP_CALL_REALTIME<class_SceneTree_constant_GROUP_CALL_REALTIME>` flag.
|
||
|
|
||
|
.. rst-class:: classref-item-separator
|
||
|
|
||
|
----
|
||
|
|
||
|
.. _class_SceneTree_method_call_group_flags:
|
||
|
|
||
|
.. rst-class:: classref-method
|
||
|
|
||
|
:ref:`Variant<class_Variant>` **call_group_flags** **(** :ref:`int<class_int>` flags, :ref:`String<class_String>` group, :ref:`String<class_String>` method, ... **)** |vararg|
|
||
|
|
||
|
Calls ``method`` on each member of the given group, respecting the given :ref:`GroupCallFlags<enum_SceneTree_GroupCallFlags>`. You can pass arguments to ``method`` by specifying them at the end of the method call.
|
||
|
|
||
|
\ **Note:** ``method`` may only have 5 arguments at most (8 arguments passed to this method in total).
|
||
|
|
||
|
\ **Note:** Due to design limitations, :ref:`call_group_flags<class_SceneTree_method_call_group_flags>` will fail silently if one of the arguments is ``null``.
|
||
|
|
||
|
::
|
||
|
|
||
|
# Call the method immediately and in reverse order.
|
||
|
get_tree().call_group_flags(SceneTree.GROUP_CALL_REALTIME | SceneTree.GROUP_CALL_REVERSE, "bases", "destroy")
|
||
|
|
||
|
.. rst-class:: classref-item-separator
|
||
|
|
||
|
----
|
||
|
|
||
|
.. _class_SceneTree_method_change_scene:
|
||
|
|
||
|
.. rst-class:: classref-method
|
||
|
|
||
|
:ref:`Error<enum_@GlobalScope_Error>` **change_scene** **(** :ref:`String<class_String>` path **)**
|
||
|
|
||
|
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:** The scene change is deferred, which means that the new scene node is added on the next idle frame. You won't be able to access it immediately after the :ref:`change_scene<class_SceneTree_method_change_scene>` call.
|
||
|
|
||
|
.. rst-class:: classref-item-separator
|
||
|
|
||
|
----
|
||
|
|
||
|
.. _class_SceneTree_method_change_scene_to:
|
||
|
|
||
|
.. rst-class:: classref-method
|
||
|
|
||
|
:ref:`Error<enum_@GlobalScope_Error>` **change_scene_to** **(** :ref:`PackedScene<class_PackedScene>` packed_scene **)**
|
||
|
|
||
|
Changes the running scene to a new instance of the given :ref:`PackedScene<class_PackedScene>`.
|
||
|
|
||
|
Returns :ref:`@GlobalScope.OK<class_@GlobalScope_constant_OK>` on success or :ref:`@GlobalScope.ERR_CANT_CREATE<class_@GlobalScope_constant_ERR_CANT_CREATE>` if the scene cannot be instantiated.
|
||
|
|
||
|
\ **Note:** The scene change is deferred, which means that the new scene node is added on the next idle frame. You won't be able to access it immediately after the :ref:`change_scene_to<class_SceneTree_method_change_scene_to>` call.
|
||
|
|
||
|
\ **Note:** Passing a value of ``null`` into the method will unload the current scene without loading a new one.
|
||
|
|
||
|
.. rst-class:: classref-item-separator
|
||
|
|
||
|
----
|
||
|
|
||
|
.. _class_SceneTree_method_create_timer:
|
||
|
|
||
|
.. rst-class:: classref-method
|
||
|
|
||
|
:ref:`SceneTreeTimer<class_SceneTreeTimer>` **create_timer** **(** :ref:`float<class_float>` time_sec, :ref:`bool<class_bool>` pause_mode_process=true **)**
|
||
|
|
||
|
Returns a :ref:`SceneTreeTimer<class_SceneTreeTimer>` which will :ref:`SceneTreeTimer.timeout<class_SceneTreeTimer_signal_timeout>` after the given time in seconds elapsed in this **SceneTree**. If ``pause_mode_process`` is set to ``false``, pausing the **SceneTree** will also pause the timer.
|
||
|
|
||
|
Commonly used to create a one-shot delay timer as in the following example:
|
||
|
|
||
|
::
|
||
|
|
||
|
func some_function():
|
||
|
print("start")
|
||
|
yield(get_tree().create_timer(1.0), "timeout")
|
||
|
print("end")
|
||
|
|
||
|
The timer will be automatically freed after its time elapses.
|
||
|
|
||
|
.. rst-class:: classref-item-separator
|
||
|
|
||
|
----
|
||
|
|
||
|
.. _class_SceneTree_method_create_tween:
|
||
|
|
||
|
.. rst-class:: classref-method
|
||
|
|
||
|
:ref:`SceneTreeTween<class_SceneTreeTween>` **create_tween** **(** **)**
|
||
|
|
||
|
Creates and returns a new :ref:`SceneTreeTween<class_SceneTreeTween>`.
|
||
|
|
||
|
.. 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** **(** :ref:`String<class_String>` group **)**
|
||
|
|
||
|
Returns the first node in the specified group, or ``null`` if the group is empty or does not exist.
|
||
|
|
||
|
.. rst-class:: classref-item-separator
|
||
|
|
||
|
----
|
||
|
|
||
|
.. _class_SceneTree_method_get_frame:
|
||
|
|
||
|
.. rst-class:: classref-method
|
||
|
|
||
|
:ref:`int<class_int>` **get_frame** **(** **)** |const|
|
||
|
|
||
|
Returns the current frame number, i.e. the total frame count since the application started.
|
||
|
|
||
|
.. rst-class:: classref-item-separator
|
||
|
|
||
|
----
|
||
|
|
||
|
.. _class_SceneTree_method_get_network_connected_peers:
|
||
|
|
||
|
.. rst-class:: classref-method
|
||
|
|
||
|
:ref:`PoolIntArray<class_PoolIntArray>` **get_network_connected_peers** **(** **)** |const|
|
||
|
|
||
|
Returns the peer IDs of all connected peers of this **SceneTree**'s :ref:`network_peer<class_SceneTree_property_network_peer>`.
|
||
|
|
||
|
.. rst-class:: classref-item-separator
|
||
|
|
||
|
----
|
||
|
|
||
|
.. _class_SceneTree_method_get_network_unique_id:
|
||
|
|
||
|
.. rst-class:: classref-method
|
||
|
|
||
|
:ref:`int<class_int>` **get_network_unique_id** **(** **)** |const|
|
||
|
|
||
|
Returns the unique peer ID of this **SceneTree**'s :ref:`network_peer<class_SceneTree_property_network_peer>`.
|
||
|
|
||
|
.. rst-class:: classref-item-separator
|
||
|
|
||
|
----
|
||
|
|
||
|
.. _class_SceneTree_method_get_node_count:
|
||
|
|
||
|
.. rst-class:: classref-method
|
||
|
|
||
|
:ref:`int<class_int>` **get_node_count** **(** **)** |const|
|
||
|
|
||
|
Returns the number of nodes in this **SceneTree**.
|
||
|
|
||
|
.. rst-class:: classref-item-separator
|
||
|
|
||
|
----
|
||
|
|
||
|
.. _class_SceneTree_method_get_nodes_in_group:
|
||
|
|
||
|
.. rst-class:: classref-method
|
||
|
|
||
|
:ref:`Array<class_Array>` **get_nodes_in_group** **(** :ref:`String<class_String>` group **)**
|
||
|
|
||
|
Returns a list of all nodes assigned to the given group.
|
||
|
|
||
|
.. rst-class:: classref-item-separator
|
||
|
|
||
|
----
|
||
|
|
||
|
.. _class_SceneTree_method_get_processed_tweens:
|
||
|
|
||
|
.. rst-class:: classref-method
|
||
|
|
||
|
:ref:`Array<class_Array>` **get_processed_tweens** **(** **)**
|
||
|
|
||
|
Returns an array of currently existing :ref:`SceneTreeTween<class_SceneTreeTween>`\ s in the **SceneTree** (both running and paused).
|
||
|
|
||
|
.. rst-class:: classref-item-separator
|
||
|
|
||
|
----
|
||
|
|
||
|
.. _class_SceneTree_method_get_rpc_sender_id:
|
||
|
|
||
|
.. rst-class:: classref-method
|
||
|
|
||
|
:ref:`int<class_int>` **get_rpc_sender_id** **(** **)** |const|
|
||
|
|
||
|
Returns the sender's peer ID for the most recently received RPC call.
|
||
|
|
||
|
.. rst-class:: classref-item-separator
|
||
|
|
||
|
----
|
||
|
|
||
|
.. _class_SceneTree_method_has_group:
|
||
|
|
||
|
.. rst-class:: classref-method
|
||
|
|
||
|
:ref:`bool<class_bool>` **has_group** **(** :ref:`String<class_String>` name **)** |const|
|
||
|
|
||
|
Returns ``true`` if the given group exists.
|
||
|
|
||
|
.. rst-class:: classref-item-separator
|
||
|
|
||
|
----
|
||
|
|
||
|
.. _class_SceneTree_method_has_network_peer:
|
||
|
|
||
|
.. rst-class:: classref-method
|
||
|
|
||
|
:ref:`bool<class_bool>` **has_network_peer** **(** **)** |const|
|
||
|
|
||
|
Returns ``true`` if there is a :ref:`network_peer<class_SceneTree_property_network_peer>` set.
|
||
|
|
||
|
.. rst-class:: classref-item-separator
|
||
|
|
||
|
----
|
||
|
|
||
|
.. _class_SceneTree_method_is_input_handled:
|
||
|
|
||
|
.. rst-class:: classref-method
|
||
|
|
||
|
:ref:`bool<class_bool>` **is_input_handled** **(** **)**
|
||
|
|
||
|
Returns ``true`` if the most recent :ref:`InputEvent<class_InputEvent>` was marked as handled with :ref:`set_input_as_handled<class_SceneTree_method_set_input_as_handled>`.
|
||
|
|
||
|
.. rst-class:: classref-item-separator
|
||
|
|
||
|
----
|
||
|
|
||
|
.. _class_SceneTree_method_is_network_server:
|
||
|
|
||
|
.. rst-class:: classref-method
|
||
|
|
||
|
:ref:`bool<class_bool>` **is_network_server** **(** **)** |const|
|
||
|
|
||
|
Returns ``true`` if this **SceneTree**'s :ref:`network_peer<class_SceneTree_property_network_peer>` is in server mode (listening for connections).
|
||
|
|
||
|
.. rst-class:: classref-item-separator
|
||
|
|
||
|
----
|
||
|
|
||
|
.. _class_SceneTree_method_notify_group:
|
||
|
|
||
|
.. rst-class:: classref-method
|
||
|
|
||
|
void **notify_group** **(** :ref:`String<class_String>` group, :ref:`int<class_int>` notification **)**
|
||
|
|
||
|
Sends the given notification to all members of the ``group``.
|
||
|
|
||
|
.. rst-class:: classref-item-separator
|
||
|
|
||
|
----
|
||
|
|
||
|
.. _class_SceneTree_method_notify_group_flags:
|
||
|
|
||
|
.. rst-class:: classref-method
|
||
|
|
||
|
void **notify_group_flags** **(** :ref:`int<class_int>` call_flags, :ref:`String<class_String>` group, :ref:`int<class_int>` notification **)**
|
||
|
|
||
|
Sends the given notification to all members of the ``group``, respecting the given :ref:`GroupCallFlags<enum_SceneTree_GroupCallFlags>`.
|
||
|
|
||
|
.. rst-class:: classref-item-separator
|
||
|
|
||
|
----
|
||
|
|
||
|
.. _class_SceneTree_method_queue_delete:
|
||
|
|
||
|
.. rst-class:: classref-method
|
||
|
|
||
|
void **queue_delete** **(** :ref:`Object<class_Object>` obj **)**
|
||
|
|
||
|
Queues the given object for deletion, delaying the call to :ref:`Object.free<class_Object_method_free>` to after the current frame.
|
||
|
|
||
|
.. rst-class:: classref-item-separator
|
||
|
|
||
|
----
|
||
|
|
||
|
.. _class_SceneTree_method_quit:
|
||
|
|
||
|
.. rst-class:: classref-method
|
||
|
|
||
|
void **quit** **(** :ref:`int<class_int>` exit_code=-1 **)**
|
||
|
|
||
|
Quits the application at the end of the current iteration. A process ``exit_code`` can optionally be passed as an argument. If this argument is ``0`` or greater, it will override the :ref:`OS.exit_code<class_OS_property_exit_code>` defined before quitting the application.
|
||
|
|
||
|
\ **Note:** On iOS this method doesn't work. Instead, as recommended by the iOS Human Interface Guidelines, 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** **(** **)**
|
||
|
|
||
|
Reloads the currently active scene.
|
||
|
|
||
|
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>` was defined yet, :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** **(** :ref:`String<class_String>` group, :ref:`String<class_String>` property, :ref:`Variant<class_Variant>` value **)**
|
||
|
|
||
|
Sets the given ``property`` to ``value`` on all members of the given group.
|
||
|
|
||
|
.. rst-class:: classref-item-separator
|
||
|
|
||
|
----
|
||
|
|
||
|
.. _class_SceneTree_method_set_group_flags:
|
||
|
|
||
|
.. rst-class:: classref-method
|
||
|
|
||
|
void **set_group_flags** **(** :ref:`int<class_int>` call_flags, :ref:`String<class_String>` group, :ref:`String<class_String>` property, :ref:`Variant<class_Variant>` value **)**
|
||
|
|
||
|
Sets the given ``property`` to ``value`` on all members of the given group, respecting the given :ref:`GroupCallFlags<enum_SceneTree_GroupCallFlags>`.
|
||
|
|
||
|
.. rst-class:: classref-item-separator
|
||
|
|
||
|
----
|
||
|
|
||
|
.. _class_SceneTree_method_set_input_as_handled:
|
||
|
|
||
|
.. rst-class:: classref-method
|
||
|
|
||
|
void **set_input_as_handled** **(** **)**
|
||
|
|
||
|
Marks the most recent :ref:`InputEvent<class_InputEvent>` as handled.
|
||
|
|
||
|
.. rst-class:: classref-item-separator
|
||
|
|
||
|
----
|
||
|
|
||
|
.. _class_SceneTree_method_set_screen_stretch:
|
||
|
|
||
|
.. rst-class:: classref-method
|
||
|
|
||
|
void **set_screen_stretch** **(** :ref:`StretchMode<enum_SceneTree_StretchMode>` mode, :ref:`StretchAspect<enum_SceneTree_StretchAspect>` aspect, :ref:`Vector2<class_Vector2>` minsize, :ref:`float<class_float>` scale=1 **)**
|
||
|
|
||
|
Configures screen stretching to the given :ref:`StretchMode<enum_SceneTree_StretchMode>`, :ref:`StretchAspect<enum_SceneTree_StretchAspect>`, minimum size and ``scale``.
|
||
|
|
||
|
.. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
|
||
|
.. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
|
||
|
.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
|
||
|
.. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
|