class_scenetree.rst 53 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075
  1. :github_url: hide
  2. .. DO NOT EDIT THIS FILE!!!
  3. .. Generated automatically from Godot engine sources.
  4. .. Generator: https://github.com/godotengine/godot/tree/3.5/doc/tools/make_rst.py.
  5. .. XML source: https://github.com/godotengine/godot/tree/3.5/doc/classes/SceneTree.xml.
  6. .. _class_SceneTree:
  7. SceneTree
  8. =========
  9. **Inherits:** :ref:`MainLoop<class_MainLoop>` **<** :ref:`Object<class_Object>`
  10. Manages the game loop via a hierarchy of nodes.
  11. .. rst-class:: classref-introduction-group
  12. Description
  13. -----------
  14. 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.
  15. 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.
  16. \ **SceneTree** is the default :ref:`MainLoop<class_MainLoop>` implementation used by scenes, and is thus in charge of the game loop.
  17. .. rst-class:: classref-introduction-group
  18. Tutorials
  19. ---------
  20. - :doc:`../tutorials/scripting/scene_tree`
  21. - :doc:`../tutorials/rendering/multiple_resolutions`
  22. .. rst-class:: classref-reftable-group
  23. Properties
  24. ----------
  25. .. table::
  26. :widths: auto
  27. +-----------------------------------------------------------------+------------------------------------------------------------------------------------------------+-----------+
  28. | :ref:`bool<class_bool>` | :ref:`auto_accept_quit<class_SceneTree_property_auto_accept_quit>` | ``true`` |
  29. +-----------------------------------------------------------------+------------------------------------------------------------------------------------------------+-----------+
  30. | :ref:`Node<class_Node>` | :ref:`current_scene<class_SceneTree_property_current_scene>` | |
  31. +-----------------------------------------------------------------+------------------------------------------------------------------------------------------------+-----------+
  32. | :ref:`bool<class_bool>` | :ref:`debug_collisions_hint<class_SceneTree_property_debug_collisions_hint>` | ``false`` |
  33. +-----------------------------------------------------------------+------------------------------------------------------------------------------------------------+-----------+
  34. | :ref:`bool<class_bool>` | :ref:`debug_navigation_hint<class_SceneTree_property_debug_navigation_hint>` | ``false`` |
  35. +-----------------------------------------------------------------+------------------------------------------------------------------------------------------------+-----------+
  36. | :ref:`Node<class_Node>` | :ref:`edited_scene_root<class_SceneTree_property_edited_scene_root>` | |
  37. +-----------------------------------------------------------------+------------------------------------------------------------------------------------------------+-----------+
  38. | :ref:`MultiplayerAPI<class_MultiplayerAPI>` | :ref:`multiplayer<class_SceneTree_property_multiplayer>` | |
  39. +-----------------------------------------------------------------+------------------------------------------------------------------------------------------------+-----------+
  40. | :ref:`bool<class_bool>` | :ref:`multiplayer_poll<class_SceneTree_property_multiplayer_poll>` | ``true`` |
  41. +-----------------------------------------------------------------+------------------------------------------------------------------------------------------------+-----------+
  42. | :ref:`NetworkedMultiplayerPeer<class_NetworkedMultiplayerPeer>` | :ref:`network_peer<class_SceneTree_property_network_peer>` | |
  43. +-----------------------------------------------------------------+------------------------------------------------------------------------------------------------+-----------+
  44. | :ref:`bool<class_bool>` | :ref:`paused<class_SceneTree_property_paused>` | ``false`` |
  45. +-----------------------------------------------------------------+------------------------------------------------------------------------------------------------+-----------+
  46. | :ref:`bool<class_bool>` | :ref:`physics_interpolation<class_SceneTree_property_physics_interpolation>` | ``false`` |
  47. +-----------------------------------------------------------------+------------------------------------------------------------------------------------------------+-----------+
  48. | :ref:`bool<class_bool>` | :ref:`quit_on_go_back<class_SceneTree_property_quit_on_go_back>` | ``true`` |
  49. +-----------------------------------------------------------------+------------------------------------------------------------------------------------------------+-----------+
  50. | :ref:`bool<class_bool>` | :ref:`refuse_new_network_connections<class_SceneTree_property_refuse_new_network_connections>` | ``false`` |
  51. +-----------------------------------------------------------------+------------------------------------------------------------------------------------------------+-----------+
  52. | :ref:`Viewport<class_Viewport>` | :ref:`root<class_SceneTree_property_root>` | |
  53. +-----------------------------------------------------------------+------------------------------------------------------------------------------------------------+-----------+
  54. | :ref:`bool<class_bool>` | :ref:`use_font_oversampling<class_SceneTree_property_use_font_oversampling>` | ``false`` |
  55. +-----------------------------------------------------------------+------------------------------------------------------------------------------------------------+-----------+
  56. .. rst-class:: classref-reftable-group
  57. Methods
  58. -------
  59. .. table::
  60. :widths: auto
  61. +---------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  62. | :ref:`Variant<class_Variant>` | :ref:`call_group<class_SceneTree_method_call_group>` **(** :ref:`String<class_String>` group, :ref:`String<class_String>` method, ... **)** |vararg| |
  63. +---------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  64. | :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| |
  65. +---------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  66. | :ref:`Error<enum_@GlobalScope_Error>` | :ref:`change_scene<class_SceneTree_method_change_scene>` **(** :ref:`String<class_String>` path **)** |
  67. +---------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  68. | :ref:`Error<enum_@GlobalScope_Error>` | :ref:`change_scene_to<class_SceneTree_method_change_scene_to>` **(** :ref:`PackedScene<class_PackedScene>` packed_scene **)** |
  69. +---------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  70. | :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 **)** |
  71. +---------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  72. | :ref:`SceneTreeTween<class_SceneTreeTween>` | :ref:`create_tween<class_SceneTree_method_create_tween>` **(** **)** |
  73. +---------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  74. | :ref:`int<class_int>` | :ref:`get_frame<class_SceneTree_method_get_frame>` **(** **)** |const| |
  75. +---------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  76. | :ref:`PoolIntArray<class_PoolIntArray>` | :ref:`get_network_connected_peers<class_SceneTree_method_get_network_connected_peers>` **(** **)** |const| |
  77. +---------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  78. | :ref:`int<class_int>` | :ref:`get_network_unique_id<class_SceneTree_method_get_network_unique_id>` **(** **)** |const| |
  79. +---------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  80. | :ref:`int<class_int>` | :ref:`get_node_count<class_SceneTree_method_get_node_count>` **(** **)** |const| |
  81. +---------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  82. | :ref:`Array<class_Array>` | :ref:`get_nodes_in_group<class_SceneTree_method_get_nodes_in_group>` **(** :ref:`String<class_String>` group **)** |
  83. +---------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  84. | :ref:`Array<class_Array>` | :ref:`get_processed_tweens<class_SceneTree_method_get_processed_tweens>` **(** **)** |
  85. +---------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  86. | :ref:`int<class_int>` | :ref:`get_rpc_sender_id<class_SceneTree_method_get_rpc_sender_id>` **(** **)** |const| |
  87. +---------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  88. | :ref:`bool<class_bool>` | :ref:`has_group<class_SceneTree_method_has_group>` **(** :ref:`String<class_String>` name **)** |const| |
  89. +---------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  90. | :ref:`bool<class_bool>` | :ref:`has_network_peer<class_SceneTree_method_has_network_peer>` **(** **)** |const| |
  91. +---------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  92. | :ref:`bool<class_bool>` | :ref:`is_input_handled<class_SceneTree_method_is_input_handled>` **(** **)** |
  93. +---------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  94. | :ref:`bool<class_bool>` | :ref:`is_network_server<class_SceneTree_method_is_network_server>` **(** **)** |const| |
  95. +---------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  96. | void | :ref:`notify_group<class_SceneTree_method_notify_group>` **(** :ref:`String<class_String>` group, :ref:`int<class_int>` notification **)** |
  97. +---------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  98. | 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 **)** |
  99. +---------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  100. | void | :ref:`queue_delete<class_SceneTree_method_queue_delete>` **(** :ref:`Object<class_Object>` obj **)** |
  101. +---------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  102. | void | :ref:`quit<class_SceneTree_method_quit>` **(** :ref:`int<class_int>` exit_code=-1 **)** |
  103. +---------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  104. | :ref:`Error<enum_@GlobalScope_Error>` | :ref:`reload_current_scene<class_SceneTree_method_reload_current_scene>` **(** **)** |
  105. +---------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  106. | void | :ref:`set_group<class_SceneTree_method_set_group>` **(** :ref:`String<class_String>` group, :ref:`String<class_String>` property, :ref:`Variant<class_Variant>` value **)** |
  107. +---------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  108. | 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 **)** |
  109. +---------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  110. | void | :ref:`set_input_as_handled<class_SceneTree_method_set_input_as_handled>` **(** **)** |
  111. +---------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  112. | 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 **)** |
  113. +---------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  114. .. rst-class:: classref-section-separator
  115. ----
  116. .. rst-class:: classref-descriptions-group
  117. Signals
  118. -------
  119. .. _class_SceneTree_signal_connected_to_server:
  120. .. rst-class:: classref-signal
  121. **connected_to_server** **(** **)**
  122. Emitted whenever this **SceneTree**'s :ref:`network_peer<class_SceneTree_property_network_peer>` successfully connected to a server. Only emitted on clients.
  123. .. rst-class:: classref-item-separator
  124. ----
  125. .. _class_SceneTree_signal_connection_failed:
  126. .. rst-class:: classref-signal
  127. **connection_failed** **(** **)**
  128. 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.
  129. .. rst-class:: classref-item-separator
  130. ----
  131. .. _class_SceneTree_signal_files_dropped:
  132. .. rst-class:: classref-signal
  133. **files_dropped** **(** :ref:`PoolStringArray<class_PoolStringArray>` files, :ref:`int<class_int>` screen **)**
  134. 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.
  135. .. rst-class:: classref-item-separator
  136. ----
  137. .. _class_SceneTree_signal_global_menu_action:
  138. .. rst-class:: classref-signal
  139. **global_menu_action** **(** :ref:`Variant<class_Variant>` id, :ref:`Variant<class_Variant>` meta **)**
  140. Emitted whenever global menu item is clicked.
  141. .. rst-class:: classref-item-separator
  142. ----
  143. .. _class_SceneTree_signal_idle_frame:
  144. .. rst-class:: classref-signal
  145. **idle_frame** **(** **)**
  146. Emitted immediately before :ref:`Node._process<class_Node_method__process>` is called on every node in the **SceneTree**.
  147. .. rst-class:: classref-item-separator
  148. ----
  149. .. _class_SceneTree_signal_network_peer_connected:
  150. .. rst-class:: classref-signal
  151. **network_peer_connected** **(** :ref:`int<class_int>` id **)**
  152. 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).
  153. .. rst-class:: classref-item-separator
  154. ----
  155. .. _class_SceneTree_signal_network_peer_disconnected:
  156. .. rst-class:: classref-signal
  157. **network_peer_disconnected** **(** :ref:`int<class_int>` id **)**
  158. 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.
  159. .. rst-class:: classref-item-separator
  160. ----
  161. .. _class_SceneTree_signal_node_added:
  162. .. rst-class:: classref-signal
  163. **node_added** **(** :ref:`Node<class_Node>` node **)**
  164. Emitted whenever a node is added to the **SceneTree**.
  165. .. rst-class:: classref-item-separator
  166. ----
  167. .. _class_SceneTree_signal_node_configuration_warning_changed:
  168. .. rst-class:: classref-signal
  169. **node_configuration_warning_changed** **(** :ref:`Node<class_Node>` node **)**
  170. Emitted when a node's configuration changed. Only emitted in ``tool`` mode.
  171. .. rst-class:: classref-item-separator
  172. ----
  173. .. _class_SceneTree_signal_node_removed:
  174. .. rst-class:: classref-signal
  175. **node_removed** **(** :ref:`Node<class_Node>` node **)**
  176. Emitted whenever a node is removed from the **SceneTree**.
  177. .. rst-class:: classref-item-separator
  178. ----
  179. .. _class_SceneTree_signal_node_renamed:
  180. .. rst-class:: classref-signal
  181. **node_renamed** **(** :ref:`Node<class_Node>` node **)**
  182. Emitted whenever a node is renamed.
  183. .. rst-class:: classref-item-separator
  184. ----
  185. .. _class_SceneTree_signal_physics_frame:
  186. .. rst-class:: classref-signal
  187. **physics_frame** **(** **)**
  188. Emitted immediately before :ref:`Node._physics_process<class_Node_method__physics_process>` is called on every node in the **SceneTree**.
  189. .. rst-class:: classref-item-separator
  190. ----
  191. .. _class_SceneTree_signal_screen_resized:
  192. .. rst-class:: classref-signal
  193. **screen_resized** **(** **)**
  194. Emitted when the screen resolution (fullscreen) or window size (windowed) changes.
  195. .. rst-class:: classref-item-separator
  196. ----
  197. .. _class_SceneTree_signal_server_disconnected:
  198. .. rst-class:: classref-signal
  199. **server_disconnected** **(** **)**
  200. Emitted whenever this **SceneTree**'s :ref:`network_peer<class_SceneTree_property_network_peer>` disconnected from server. Only emitted on clients.
  201. .. rst-class:: classref-item-separator
  202. ----
  203. .. _class_SceneTree_signal_tree_changed:
  204. .. rst-class:: classref-signal
  205. **tree_changed** **(** **)**
  206. Emitted whenever the **SceneTree** hierarchy changed (children being moved or renamed, etc.).
  207. .. rst-class:: classref-section-separator
  208. ----
  209. .. rst-class:: classref-descriptions-group
  210. Enumerations
  211. ------------
  212. .. _enum_SceneTree_GroupCallFlags:
  213. .. rst-class:: classref-enumeration
  214. enum **GroupCallFlags**:
  215. .. _class_SceneTree_constant_GROUP_CALL_DEFAULT:
  216. .. rst-class:: classref-enumeration-constant
  217. :ref:`GroupCallFlags<enum_SceneTree_GroupCallFlags>` **GROUP_CALL_DEFAULT** = ``0``
  218. Call a group with no flags (default).
  219. .. _class_SceneTree_constant_GROUP_CALL_REVERSE:
  220. .. rst-class:: classref-enumeration-constant
  221. :ref:`GroupCallFlags<enum_SceneTree_GroupCallFlags>` **GROUP_CALL_REVERSE** = ``1``
  222. Call a group in reverse scene order.
  223. .. _class_SceneTree_constant_GROUP_CALL_REALTIME:
  224. .. rst-class:: classref-enumeration-constant
  225. :ref:`GroupCallFlags<enum_SceneTree_GroupCallFlags>` **GROUP_CALL_REALTIME** = ``2``
  226. Call a group immediately (calls are normally made on idle).
  227. .. _class_SceneTree_constant_GROUP_CALL_UNIQUE:
  228. .. rst-class:: classref-enumeration-constant
  229. :ref:`GroupCallFlags<enum_SceneTree_GroupCallFlags>` **GROUP_CALL_UNIQUE** = ``4``
  230. Call a group only once even if the call is executed many times.
  231. \ **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.
  232. .. rst-class:: classref-item-separator
  233. ----
  234. .. _enum_SceneTree_StretchMode:
  235. .. rst-class:: classref-enumeration
  236. enum **StretchMode**:
  237. .. _class_SceneTree_constant_STRETCH_MODE_DISABLED:
  238. .. rst-class:: classref-enumeration-constant
  239. :ref:`StretchMode<enum_SceneTree_StretchMode>` **STRETCH_MODE_DISABLED** = ``0``
  240. No stretching.
  241. .. _class_SceneTree_constant_STRETCH_MODE_2D:
  242. .. rst-class:: classref-enumeration-constant
  243. :ref:`StretchMode<enum_SceneTree_StretchMode>` **STRETCH_MODE_2D** = ``1``
  244. Render stretching in higher resolution (interpolated).
  245. .. _class_SceneTree_constant_STRETCH_MODE_VIEWPORT:
  246. .. rst-class:: classref-enumeration-constant
  247. :ref:`StretchMode<enum_SceneTree_StretchMode>` **STRETCH_MODE_VIEWPORT** = ``2``
  248. Keep the specified display resolution. No interpolation. Content may appear pixelated.
  249. .. rst-class:: classref-item-separator
  250. ----
  251. .. _enum_SceneTree_StretchAspect:
  252. .. rst-class:: classref-enumeration
  253. enum **StretchAspect**:
  254. .. _class_SceneTree_constant_STRETCH_ASPECT_IGNORE:
  255. .. rst-class:: classref-enumeration-constant
  256. :ref:`StretchAspect<enum_SceneTree_StretchAspect>` **STRETCH_ASPECT_IGNORE** = ``0``
  257. Fill the window with the content stretched to cover excessive space. Content may appear stretched.
  258. .. _class_SceneTree_constant_STRETCH_ASPECT_KEEP:
  259. .. rst-class:: classref-enumeration-constant
  260. :ref:`StretchAspect<enum_SceneTree_StretchAspect>` **STRETCH_ASPECT_KEEP** = ``1``
  261. Retain the same aspect ratio by padding with black bars on either axis. This prevents distortion.
  262. .. _class_SceneTree_constant_STRETCH_ASPECT_KEEP_WIDTH:
  263. .. rst-class:: classref-enumeration-constant
  264. :ref:`StretchAspect<enum_SceneTree_StretchAspect>` **STRETCH_ASPECT_KEEP_WIDTH** = ``2``
  265. Expand vertically. Left/right black bars may appear if the window is too wide.
  266. .. _class_SceneTree_constant_STRETCH_ASPECT_KEEP_HEIGHT:
  267. .. rst-class:: classref-enumeration-constant
  268. :ref:`StretchAspect<enum_SceneTree_StretchAspect>` **STRETCH_ASPECT_KEEP_HEIGHT** = ``3``
  269. Expand horizontally. Top/bottom black bars may appear if the window is too tall.
  270. .. _class_SceneTree_constant_STRETCH_ASPECT_EXPAND:
  271. .. rst-class:: classref-enumeration-constant
  272. :ref:`StretchAspect<enum_SceneTree_StretchAspect>` **STRETCH_ASPECT_EXPAND** = ``4``
  273. Expand in both directions, retaining the same aspect ratio. This prevents distortion while avoiding black bars.
  274. .. rst-class:: classref-section-separator
  275. ----
  276. .. rst-class:: classref-descriptions-group
  277. Property Descriptions
  278. ---------------------
  279. .. _class_SceneTree_property_auto_accept_quit:
  280. .. rst-class:: classref-property
  281. :ref:`bool<class_bool>` **auto_accept_quit** = ``true``
  282. .. rst-class:: classref-property-setget
  283. - void **set_auto_accept_quit** **(** :ref:`bool<class_bool>` value **)**
  284. - :ref:`bool<class_bool>` **is_auto_accept_quit** **(** **)**
  285. If ``true``, the application automatically accepts quitting.
  286. For mobile platforms, see :ref:`quit_on_go_back<class_SceneTree_property_quit_on_go_back>`.
  287. .. rst-class:: classref-item-separator
  288. ----
  289. .. _class_SceneTree_property_current_scene:
  290. .. rst-class:: classref-property
  291. :ref:`Node<class_Node>` **current_scene**
  292. .. rst-class:: classref-property-setget
  293. - void **set_current_scene** **(** :ref:`Node<class_Node>` value **)**
  294. - :ref:`Node<class_Node>` **get_current_scene** **(** **)**
  295. The current scene.
  296. .. rst-class:: classref-item-separator
  297. ----
  298. .. _class_SceneTree_property_debug_collisions_hint:
  299. .. rst-class:: classref-property
  300. :ref:`bool<class_bool>` **debug_collisions_hint** = ``false``
  301. .. rst-class:: classref-property-setget
  302. - void **set_debug_collisions_hint** **(** :ref:`bool<class_bool>` value **)**
  303. - :ref:`bool<class_bool>` **is_debugging_collisions_hint** **(** **)**
  304. If ``true``, collision shapes will be visible when running the game from the editor for debugging purposes.
  305. \ **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.
  306. .. rst-class:: classref-item-separator
  307. ----
  308. .. _class_SceneTree_property_debug_navigation_hint:
  309. .. rst-class:: classref-property
  310. :ref:`bool<class_bool>` **debug_navigation_hint** = ``false``
  311. .. rst-class:: classref-property-setget
  312. - void **set_debug_navigation_hint** **(** :ref:`bool<class_bool>` value **)**
  313. - :ref:`bool<class_bool>` **is_debugging_navigation_hint** **(** **)**
  314. If ``true``, navigation polygons will be visible when running the game from the editor for debugging purposes.
  315. \ **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.
  316. .. rst-class:: classref-item-separator
  317. ----
  318. .. _class_SceneTree_property_edited_scene_root:
  319. .. rst-class:: classref-property
  320. :ref:`Node<class_Node>` **edited_scene_root**
  321. .. rst-class:: classref-property-setget
  322. - void **set_edited_scene_root** **(** :ref:`Node<class_Node>` value **)**
  323. - :ref:`Node<class_Node>` **get_edited_scene_root** **(** **)**
  324. The root of the edited scene.
  325. .. rst-class:: classref-item-separator
  326. ----
  327. .. _class_SceneTree_property_multiplayer:
  328. .. rst-class:: classref-property
  329. :ref:`MultiplayerAPI<class_MultiplayerAPI>` **multiplayer**
  330. .. rst-class:: classref-property-setget
  331. - void **set_multiplayer** **(** :ref:`MultiplayerAPI<class_MultiplayerAPI>` value **)**
  332. - :ref:`MultiplayerAPI<class_MultiplayerAPI>` **get_multiplayer** **(** **)**
  333. The default :ref:`MultiplayerAPI<class_MultiplayerAPI>` instance for this **SceneTree**.
  334. .. rst-class:: classref-item-separator
  335. ----
  336. .. _class_SceneTree_property_multiplayer_poll:
  337. .. rst-class:: classref-property
  338. :ref:`bool<class_bool>` **multiplayer_poll** = ``true``
  339. .. rst-class:: classref-property-setget
  340. - void **set_multiplayer_poll_enabled** **(** :ref:`bool<class_bool>` value **)**
  341. - :ref:`bool<class_bool>` **is_multiplayer_poll_enabled** **(** **)**
  342. 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>`.
  343. 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.
  344. .. rst-class:: classref-item-separator
  345. ----
  346. .. _class_SceneTree_property_network_peer:
  347. .. rst-class:: classref-property
  348. :ref:`NetworkedMultiplayerPeer<class_NetworkedMultiplayerPeer>` **network_peer**
  349. .. rst-class:: classref-property-setget
  350. - void **set_network_peer** **(** :ref:`NetworkedMultiplayerPeer<class_NetworkedMultiplayerPeer>` value **)**
  351. - :ref:`NetworkedMultiplayerPeer<class_NetworkedMultiplayerPeer>` **get_network_peer** **(** **)**
  352. 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.
  353. .. rst-class:: classref-item-separator
  354. ----
  355. .. _class_SceneTree_property_paused:
  356. .. rst-class:: classref-property
  357. :ref:`bool<class_bool>` **paused** = ``false``
  358. .. rst-class:: classref-property-setget
  359. - void **set_pause** **(** :ref:`bool<class_bool>` value **)**
  360. - :ref:`bool<class_bool>` **is_paused** **(** **)**
  361. If ``true``, the **SceneTree** is paused. Doing so will have the following behavior:
  362. - 2D and 3D physics will be stopped. This includes signals and collision detection.
  363. - :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.
  364. .. rst-class:: classref-item-separator
  365. ----
  366. .. _class_SceneTree_property_physics_interpolation:
  367. .. rst-class:: classref-property
  368. :ref:`bool<class_bool>` **physics_interpolation** = ``false``
  369. .. rst-class:: classref-property-setget
  370. - void **set_physics_interpolation_enabled** **(** :ref:`bool<class_bool>` value **)**
  371. - :ref:`bool<class_bool>` **is_physics_interpolation_enabled** **(** **)**
  372. 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.
  373. .. rst-class:: classref-item-separator
  374. ----
  375. .. _class_SceneTree_property_quit_on_go_back:
  376. .. rst-class:: classref-property
  377. :ref:`bool<class_bool>` **quit_on_go_back** = ``true``
  378. .. rst-class:: classref-property-setget
  379. - void **set_quit_on_go_back** **(** :ref:`bool<class_bool>` value **)**
  380. - :ref:`bool<class_bool>` **is_quit_on_go_back** **(** **)**
  381. If ``true``, the application quits automatically on going back (e.g. on Android).
  382. 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>`.
  383. .. rst-class:: classref-item-separator
  384. ----
  385. .. _class_SceneTree_property_refuse_new_network_connections:
  386. .. rst-class:: classref-property
  387. :ref:`bool<class_bool>` **refuse_new_network_connections** = ``false``
  388. .. rst-class:: classref-property-setget
  389. - void **set_refuse_new_network_connections** **(** :ref:`bool<class_bool>` value **)**
  390. - :ref:`bool<class_bool>` **is_refusing_new_network_connections** **(** **)**
  391. If ``true``, the **SceneTree**'s :ref:`network_peer<class_SceneTree_property_network_peer>` refuses new incoming connections.
  392. .. rst-class:: classref-item-separator
  393. ----
  394. .. _class_SceneTree_property_root:
  395. .. rst-class:: classref-property
  396. :ref:`Viewport<class_Viewport>` **root**
  397. .. rst-class:: classref-property-setget
  398. - :ref:`Viewport<class_Viewport>` **get_root** **(** **)**
  399. The **SceneTree**'s root :ref:`Viewport<class_Viewport>`.
  400. .. rst-class:: classref-item-separator
  401. ----
  402. .. _class_SceneTree_property_use_font_oversampling:
  403. .. rst-class:: classref-property
  404. :ref:`bool<class_bool>` **use_font_oversampling** = ``false``
  405. .. rst-class:: classref-property-setget
  406. - void **set_use_font_oversampling** **(** :ref:`bool<class_bool>` value **)**
  407. - :ref:`bool<class_bool>` **is_using_font_oversampling** **(** **)**
  408. 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``).
  409. \ **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>`.
  410. \ **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.
  411. .. rst-class:: classref-section-separator
  412. ----
  413. .. rst-class:: classref-descriptions-group
  414. Method Descriptions
  415. -------------------
  416. .. _class_SceneTree_method_call_group:
  417. .. rst-class:: classref-method
  418. :ref:`Variant<class_Variant>` **call_group** **(** :ref:`String<class_String>` group, :ref:`String<class_String>` method, ... **)** |vararg|
  419. 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.
  420. \ **Note:** ``method`` may only have 5 arguments at most (7 arguments passed to this method in total).
  421. \ **Note:** Due to design limitations, :ref:`call_group<class_SceneTree_method_call_group>` will fail silently if one of the arguments is ``null``.
  422. \ **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.
  423. .. rst-class:: classref-item-separator
  424. ----
  425. .. _class_SceneTree_method_call_group_flags:
  426. .. rst-class:: classref-method
  427. :ref:`Variant<class_Variant>` **call_group_flags** **(** :ref:`int<class_int>` flags, :ref:`String<class_String>` group, :ref:`String<class_String>` method, ... **)** |vararg|
  428. 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.
  429. \ **Note:** ``method`` may only have 5 arguments at most (8 arguments passed to this method in total).
  430. \ **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``.
  431. ::
  432. # Call the method immediately and in reverse order.
  433. get_tree().call_group_flags(SceneTree.GROUP_CALL_REALTIME | SceneTree.GROUP_CALL_REVERSE, "bases", "destroy")
  434. .. rst-class:: classref-item-separator
  435. ----
  436. .. _class_SceneTree_method_change_scene:
  437. .. rst-class:: classref-method
  438. :ref:`Error<enum_@GlobalScope_Error>` **change_scene** **(** :ref:`String<class_String>` path **)**
  439. 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.
  440. 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.
  441. \ **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.
  442. .. rst-class:: classref-item-separator
  443. ----
  444. .. _class_SceneTree_method_change_scene_to:
  445. .. rst-class:: classref-method
  446. :ref:`Error<enum_@GlobalScope_Error>` **change_scene_to** **(** :ref:`PackedScene<class_PackedScene>` packed_scene **)**
  447. Changes the running scene to a new instance of the given :ref:`PackedScene<class_PackedScene>`.
  448. 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.
  449. \ **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.
  450. \ **Note:** Passing a value of ``null`` into the method will unload the current scene without loading a new one.
  451. .. rst-class:: classref-item-separator
  452. ----
  453. .. _class_SceneTree_method_create_timer:
  454. .. rst-class:: classref-method
  455. :ref:`SceneTreeTimer<class_SceneTreeTimer>` **create_timer** **(** :ref:`float<class_float>` time_sec, :ref:`bool<class_bool>` pause_mode_process=true **)**
  456. 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.
  457. Commonly used to create a one-shot delay timer as in the following example:
  458. ::
  459. func some_function():
  460. print("start")
  461. yield(get_tree().create_timer(1.0), "timeout")
  462. print("end")
  463. The timer will be automatically freed after its time elapses.
  464. .. rst-class:: classref-item-separator
  465. ----
  466. .. _class_SceneTree_method_create_tween:
  467. .. rst-class:: classref-method
  468. :ref:`SceneTreeTween<class_SceneTreeTween>` **create_tween** **(** **)**
  469. Creates and returns a new :ref:`SceneTreeTween<class_SceneTreeTween>`.
  470. .. rst-class:: classref-item-separator
  471. ----
  472. .. _class_SceneTree_method_get_frame:
  473. .. rst-class:: classref-method
  474. :ref:`int<class_int>` **get_frame** **(** **)** |const|
  475. Returns the current frame number, i.e. the total frame count since the application started.
  476. .. rst-class:: classref-item-separator
  477. ----
  478. .. _class_SceneTree_method_get_network_connected_peers:
  479. .. rst-class:: classref-method
  480. :ref:`PoolIntArray<class_PoolIntArray>` **get_network_connected_peers** **(** **)** |const|
  481. Returns the peer IDs of all connected peers of this **SceneTree**'s :ref:`network_peer<class_SceneTree_property_network_peer>`.
  482. .. rst-class:: classref-item-separator
  483. ----
  484. .. _class_SceneTree_method_get_network_unique_id:
  485. .. rst-class:: classref-method
  486. :ref:`int<class_int>` **get_network_unique_id** **(** **)** |const|
  487. Returns the unique peer ID of this **SceneTree**'s :ref:`network_peer<class_SceneTree_property_network_peer>`.
  488. .. rst-class:: classref-item-separator
  489. ----
  490. .. _class_SceneTree_method_get_node_count:
  491. .. rst-class:: classref-method
  492. :ref:`int<class_int>` **get_node_count** **(** **)** |const|
  493. Returns the number of nodes in this **SceneTree**.
  494. .. rst-class:: classref-item-separator
  495. ----
  496. .. _class_SceneTree_method_get_nodes_in_group:
  497. .. rst-class:: classref-method
  498. :ref:`Array<class_Array>` **get_nodes_in_group** **(** :ref:`String<class_String>` group **)**
  499. Returns a list of all nodes assigned to the given group.
  500. .. rst-class:: classref-item-separator
  501. ----
  502. .. _class_SceneTree_method_get_processed_tweens:
  503. .. rst-class:: classref-method
  504. :ref:`Array<class_Array>` **get_processed_tweens** **(** **)**
  505. Returns an array of currently existing :ref:`SceneTreeTween<class_SceneTreeTween>`\ s in the **SceneTree** (both running and paused).
  506. .. rst-class:: classref-item-separator
  507. ----
  508. .. _class_SceneTree_method_get_rpc_sender_id:
  509. .. rst-class:: classref-method
  510. :ref:`int<class_int>` **get_rpc_sender_id** **(** **)** |const|
  511. Returns the sender's peer ID for the most recently received RPC call.
  512. .. rst-class:: classref-item-separator
  513. ----
  514. .. _class_SceneTree_method_has_group:
  515. .. rst-class:: classref-method
  516. :ref:`bool<class_bool>` **has_group** **(** :ref:`String<class_String>` name **)** |const|
  517. Returns ``true`` if the given group exists.
  518. .. rst-class:: classref-item-separator
  519. ----
  520. .. _class_SceneTree_method_has_network_peer:
  521. .. rst-class:: classref-method
  522. :ref:`bool<class_bool>` **has_network_peer** **(** **)** |const|
  523. Returns ``true`` if there is a :ref:`network_peer<class_SceneTree_property_network_peer>` set.
  524. .. rst-class:: classref-item-separator
  525. ----
  526. .. _class_SceneTree_method_is_input_handled:
  527. .. rst-class:: classref-method
  528. :ref:`bool<class_bool>` **is_input_handled** **(** **)**
  529. 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>`.
  530. .. rst-class:: classref-item-separator
  531. ----
  532. .. _class_SceneTree_method_is_network_server:
  533. .. rst-class:: classref-method
  534. :ref:`bool<class_bool>` **is_network_server** **(** **)** |const|
  535. Returns ``true`` if this **SceneTree**'s :ref:`network_peer<class_SceneTree_property_network_peer>` is in server mode (listening for connections).
  536. .. rst-class:: classref-item-separator
  537. ----
  538. .. _class_SceneTree_method_notify_group:
  539. .. rst-class:: classref-method
  540. void **notify_group** **(** :ref:`String<class_String>` group, :ref:`int<class_int>` notification **)**
  541. Sends the given notification to all members of the ``group``.
  542. .. rst-class:: classref-item-separator
  543. ----
  544. .. _class_SceneTree_method_notify_group_flags:
  545. .. rst-class:: classref-method
  546. void **notify_group_flags** **(** :ref:`int<class_int>` call_flags, :ref:`String<class_String>` group, :ref:`int<class_int>` notification **)**
  547. Sends the given notification to all members of the ``group``, respecting the given :ref:`GroupCallFlags<enum_SceneTree_GroupCallFlags>`.
  548. .. rst-class:: classref-item-separator
  549. ----
  550. .. _class_SceneTree_method_queue_delete:
  551. .. rst-class:: classref-method
  552. void **queue_delete** **(** :ref:`Object<class_Object>` obj **)**
  553. Queues the given object for deletion, delaying the call to :ref:`Object.free<class_Object_method_free>` to after the current frame.
  554. .. rst-class:: classref-item-separator
  555. ----
  556. .. _class_SceneTree_method_quit:
  557. .. rst-class:: classref-method
  558. void **quit** **(** :ref:`int<class_int>` exit_code=-1 **)**
  559. 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.
  560. \ **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.
  561. .. rst-class:: classref-item-separator
  562. ----
  563. .. _class_SceneTree_method_reload_current_scene:
  564. .. rst-class:: classref-method
  565. :ref:`Error<enum_@GlobalScope_Error>` **reload_current_scene** **(** **)**
  566. Reloads the currently active scene.
  567. 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.
  568. .. rst-class:: classref-item-separator
  569. ----
  570. .. _class_SceneTree_method_set_group:
  571. .. rst-class:: classref-method
  572. void **set_group** **(** :ref:`String<class_String>` group, :ref:`String<class_String>` property, :ref:`Variant<class_Variant>` value **)**
  573. Sets the given ``property`` to ``value`` on all members of the given group.
  574. .. rst-class:: classref-item-separator
  575. ----
  576. .. _class_SceneTree_method_set_group_flags:
  577. .. rst-class:: classref-method
  578. 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 **)**
  579. Sets the given ``property`` to ``value`` on all members of the given group, respecting the given :ref:`GroupCallFlags<enum_SceneTree_GroupCallFlags>`.
  580. .. rst-class:: classref-item-separator
  581. ----
  582. .. _class_SceneTree_method_set_input_as_handled:
  583. .. rst-class:: classref-method
  584. void **set_input_as_handled** **(** **)**
  585. Marks the most recent :ref:`InputEvent<class_InputEvent>` as handled.
  586. .. rst-class:: classref-item-separator
  587. ----
  588. .. _class_SceneTree_method_set_screen_stretch:
  589. .. rst-class:: classref-method
  590. 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 **)**
  591. Configures screen stretching to the given :ref:`StretchMode<enum_SceneTree_StretchMode>`, :ref:`StretchAspect<enum_SceneTree_StretchAspect>`, minimum size and ``scale``.
  592. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  593. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  594. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  595. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`