class_scenetree.rst 54 KB

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