class_node.rst 131 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313
  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/master/doc/tools/make_rst.py.
  5. .. XML source: https://github.com/godotengine/godot/tree/master/doc/classes/Node.xml.
  6. .. _class_Node:
  7. Node
  8. ====
  9. **Inherits:** :ref:`Object<class_Object>`
  10. **Inherited By:** :ref:`AnimationPlayer<class_AnimationPlayer>`, :ref:`AnimationTree<class_AnimationTree>`, :ref:`AudioStreamPlayer<class_AudioStreamPlayer>`, :ref:`CanvasItem<class_CanvasItem>`, :ref:`CanvasLayer<class_CanvasLayer>`, :ref:`EditorFileSystem<class_EditorFileSystem>`, :ref:`EditorInterface<class_EditorInterface>`, :ref:`EditorPlugin<class_EditorPlugin>`, :ref:`EditorResourcePreview<class_EditorResourcePreview>`, :ref:`HTTPRequest<class_HTTPRequest>`, :ref:`InstancePlaceholder<class_InstancePlaceholder>`, :ref:`MissingNode<class_MissingNode>`, :ref:`MultiplayerSpawner<class_MultiplayerSpawner>`, :ref:`MultiplayerSynchronizer<class_MultiplayerSynchronizer>`, :ref:`NavigationAgent2D<class_NavigationAgent2D>`, :ref:`NavigationAgent3D<class_NavigationAgent3D>`, :ref:`NavigationObstacle2D<class_NavigationObstacle2D>`, :ref:`NavigationObstacle3D<class_NavigationObstacle3D>`, :ref:`Node3D<class_Node3D>`, :ref:`ResourcePreloader<class_ResourcePreloader>`, :ref:`ShaderGlobalsOverride<class_ShaderGlobalsOverride>`, :ref:`SkeletonIK3D<class_SkeletonIK3D>`, :ref:`Timer<class_Timer>`, :ref:`Viewport<class_Viewport>`, :ref:`WorldEnvironment<class_WorldEnvironment>`
  11. Base class for all *scene* objects.
  12. .. rst-class:: classref-introduction-group
  13. Description
  14. -----------
  15. Nodes are Godot's building blocks. They can be assigned as the child of another node, resulting in a tree arrangement. A given node can contain any number of nodes as children with the requirement that all siblings (direct children of a node) should have unique names.
  16. A tree of nodes is called a *scene*. Scenes can be saved to the disk and then instantiated into other scenes. This allows for very high flexibility in the architecture and data model of Godot projects.
  17. \ **Scene tree:** The :ref:`SceneTree<class_SceneTree>` contains the active tree of nodes. When a node is added to the scene tree, it receives the :ref:`NOTIFICATION_ENTER_TREE<class_Node_constant_NOTIFICATION_ENTER_TREE>` notification and its :ref:`_enter_tree<class_Node_method__enter_tree>` callback is triggered. Child nodes are always added *after* their parent node, i.e. the :ref:`_enter_tree<class_Node_method__enter_tree>` callback of a parent node will be triggered before its child's.
  18. Once all nodes have been added in the scene tree, they receive the :ref:`NOTIFICATION_READY<class_Node_constant_NOTIFICATION_READY>` notification and their respective :ref:`_ready<class_Node_method__ready>` callbacks are triggered. For groups of nodes, the :ref:`_ready<class_Node_method__ready>` callback is called in reverse order, starting with the children and moving up to the parent nodes.
  19. This means that when adding a node to the scene tree, the following order will be used for the callbacks: :ref:`_enter_tree<class_Node_method__enter_tree>` of the parent, :ref:`_enter_tree<class_Node_method__enter_tree>` of the children, :ref:`_ready<class_Node_method__ready>` of the children and finally :ref:`_ready<class_Node_method__ready>` of the parent (recursively for the entire scene tree).
  20. \ **Processing:** Nodes can override the "process" state, so that they receive a callback on each frame requesting them to process (do something). Normal processing (callback :ref:`_process<class_Node_method__process>`, toggled with :ref:`set_process<class_Node_method_set_process>`) happens as fast as possible and is dependent on the frame rate, so the processing time *delta* (in seconds) is passed as an argument. Physics processing (callback :ref:`_physics_process<class_Node_method__physics_process>`, toggled with :ref:`set_physics_process<class_Node_method_set_physics_process>`) happens a fixed number of times per second (60 by default) and is useful for code related to the physics engine.
  21. Nodes can also process input events. When present, the :ref:`_input<class_Node_method__input>` function will be called for each input that the program receives. In many cases, this can be overkill (unless used for simple projects), and the :ref:`_unhandled_input<class_Node_method__unhandled_input>` function might be preferred; it is called when the input event was not handled by anyone else (typically, GUI :ref:`Control<class_Control>` nodes), ensuring that the node only receives the events that were meant for it.
  22. To keep track of the scene hierarchy (especially when instancing scenes into other scenes), an "owner" can be set for the node with the :ref:`owner<class_Node_property_owner>` property. This keeps track of who instantiated what. This is mostly useful when writing editors and tools, though.
  23. Finally, when a node is freed with :ref:`Object.free<class_Object_method_free>` or :ref:`queue_free<class_Node_method_queue_free>`, it will also free all its children.
  24. \ **Groups:** Nodes can be added to as many groups as you want to be easy to manage, you could create groups like "enemies" or "collectables" for example, depending on your game. See :ref:`add_to_group<class_Node_method_add_to_group>`, :ref:`is_in_group<class_Node_method_is_in_group>` and :ref:`remove_from_group<class_Node_method_remove_from_group>`. You can then retrieve all nodes in these groups, iterate them and even call methods on groups via the methods on :ref:`SceneTree<class_SceneTree>`.
  25. \ **Networking with nodes:** After connecting to a server (or making one, see :ref:`ENetMultiplayerPeer<class_ENetMultiplayerPeer>`), it is possible to use the built-in RPC (remote procedure call) system to communicate over the network. By calling :ref:`rpc<class_Node_method_rpc>` with a method name, it will be called locally and in all connected peers (peers = clients and the server that accepts connections). To identify which node receives the RPC call, Godot will use its :ref:`NodePath<class_NodePath>` (make sure node names are the same on all peers). Also, take a look at the high-level networking tutorial and corresponding demos.
  26. \ **Note:** The ``script`` property is part of the :ref:`Object<class_Object>` class, not **Node**. It isn't exposed like most properties but does have a setter and getter (``set_script()`` and ``get_script()``).
  27. .. rst-class:: classref-introduction-group
  28. Tutorials
  29. ---------
  30. - :doc:`Nodes and scenes <../getting_started/step_by_step/nodes_and_scenes>`
  31. - `All Demos <https://github.com/godotengine/godot-demo-projects/>`__
  32. .. rst-class:: classref-reftable-group
  33. Properties
  34. ----------
  35. .. table::
  36. :widths: auto
  37. +---------------------------------------------+-----------------------------------------------------------------------+-----------+
  38. | :ref:`String<class_String>` | :ref:`editor_description<class_Node_property_editor_description>` | ``""`` |
  39. +---------------------------------------------+-----------------------------------------------------------------------+-----------+
  40. | :ref:`MultiplayerAPI<class_MultiplayerAPI>` | :ref:`multiplayer<class_Node_property_multiplayer>` | |
  41. +---------------------------------------------+-----------------------------------------------------------------------+-----------+
  42. | :ref:`StringName<class_StringName>` | :ref:`name<class_Node_property_name>` | |
  43. +---------------------------------------------+-----------------------------------------------------------------------+-----------+
  44. | :ref:`Node<class_Node>` | :ref:`owner<class_Node_property_owner>` | |
  45. +---------------------------------------------+-----------------------------------------------------------------------+-----------+
  46. | :ref:`ProcessMode<enum_Node_ProcessMode>` | :ref:`process_mode<class_Node_property_process_mode>` | ``0`` |
  47. +---------------------------------------------+-----------------------------------------------------------------------+-----------+
  48. | :ref:`int<class_int>` | :ref:`process_priority<class_Node_property_process_priority>` | ``0`` |
  49. +---------------------------------------------+-----------------------------------------------------------------------+-----------+
  50. | :ref:`String<class_String>` | :ref:`scene_file_path<class_Node_property_scene_file_path>` | |
  51. +---------------------------------------------+-----------------------------------------------------------------------+-----------+
  52. | :ref:`bool<class_bool>` | :ref:`unique_name_in_owner<class_Node_property_unique_name_in_owner>` | ``false`` |
  53. +---------------------------------------------+-----------------------------------------------------------------------+-----------+
  54. .. rst-class:: classref-reftable-group
  55. Methods
  56. -------
  57. .. table::
  58. :widths: auto
  59. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  60. | void | :ref:`_enter_tree<class_Node_method__enter_tree>` **(** **)** |virtual| |
  61. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  62. | void | :ref:`_exit_tree<class_Node_method__exit_tree>` **(** **)** |virtual| |
  63. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  64. | :ref:`PackedStringArray<class_PackedStringArray>` | :ref:`_get_configuration_warnings<class_Node_method__get_configuration_warnings>` **(** **)** |virtual| |const| |
  65. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  66. | void | :ref:`_input<class_Node_method__input>` **(** :ref:`InputEvent<class_InputEvent>` event **)** |virtual| |
  67. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  68. | void | :ref:`_physics_process<class_Node_method__physics_process>` **(** :ref:`float<class_float>` delta **)** |virtual| |
  69. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  70. | void | :ref:`_process<class_Node_method__process>` **(** :ref:`float<class_float>` delta **)** |virtual| |
  71. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  72. | void | :ref:`_ready<class_Node_method__ready>` **(** **)** |virtual| |
  73. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  74. | void | :ref:`_shortcut_input<class_Node_method__shortcut_input>` **(** :ref:`InputEvent<class_InputEvent>` event **)** |virtual| |
  75. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  76. | void | :ref:`_unhandled_input<class_Node_method__unhandled_input>` **(** :ref:`InputEvent<class_InputEvent>` event **)** |virtual| |
  77. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  78. | void | :ref:`_unhandled_key_input<class_Node_method__unhandled_key_input>` **(** :ref:`InputEvent<class_InputEvent>` event **)** |virtual| |
  79. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  80. | void | :ref:`add_child<class_Node_method_add_child>` **(** :ref:`Node<class_Node>` node, :ref:`bool<class_bool>` force_readable_name=false, :ref:`InternalMode<enum_Node_InternalMode>` internal=0 **)** |
  81. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  82. | void | :ref:`add_sibling<class_Node_method_add_sibling>` **(** :ref:`Node<class_Node>` sibling, :ref:`bool<class_bool>` force_readable_name=false **)** |
  83. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  84. | void | :ref:`add_to_group<class_Node_method_add_to_group>` **(** :ref:`StringName<class_StringName>` group, :ref:`bool<class_bool>` persistent=false **)** |
  85. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  86. | :ref:`bool<class_bool>` | :ref:`can_process<class_Node_method_can_process>` **(** **)** |const| |
  87. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  88. | :ref:`Tween<class_Tween>` | :ref:`create_tween<class_Node_method_create_tween>` **(** **)** |
  89. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  90. | :ref:`Node<class_Node>` | :ref:`duplicate<class_Node_method_duplicate>` **(** :ref:`int<class_int>` flags=15 **)** |const| |
  91. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  92. | :ref:`Node<class_Node>` | :ref:`find_child<class_Node_method_find_child>` **(** :ref:`String<class_String>` pattern, :ref:`bool<class_bool>` recursive=true, :ref:`bool<class_bool>` owned=true **)** |const| |
  93. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  94. | :ref:`Node[]<class_Node>` | :ref:`find_children<class_Node_method_find_children>` **(** :ref:`String<class_String>` pattern, :ref:`String<class_String>` type="", :ref:`bool<class_bool>` recursive=true, :ref:`bool<class_bool>` owned=true **)** |const| |
  95. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  96. | :ref:`Node<class_Node>` | :ref:`find_parent<class_Node_method_find_parent>` **(** :ref:`String<class_String>` pattern **)** |const| |
  97. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  98. | :ref:`Node<class_Node>` | :ref:`get_child<class_Node_method_get_child>` **(** :ref:`int<class_int>` idx, :ref:`bool<class_bool>` include_internal=false **)** |const| |
  99. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  100. | :ref:`int<class_int>` | :ref:`get_child_count<class_Node_method_get_child_count>` **(** :ref:`bool<class_bool>` include_internal=false **)** |const| |
  101. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  102. | :ref:`Node[]<class_Node>` | :ref:`get_children<class_Node_method_get_children>` **(** :ref:`bool<class_bool>` include_internal=false **)** |const| |
  103. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  104. | :ref:`StringName[]<class_StringName>` | :ref:`get_groups<class_Node_method_get_groups>` **(** **)** |const| |
  105. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  106. | :ref:`int<class_int>` | :ref:`get_index<class_Node_method_get_index>` **(** :ref:`bool<class_bool>` include_internal=false **)** |const| |
  107. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  108. | :ref:`int<class_int>` | :ref:`get_multiplayer_authority<class_Node_method_get_multiplayer_authority>` **(** **)** |const| |
  109. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  110. | :ref:`Node<class_Node>` | :ref:`get_node<class_Node_method_get_node>` **(** :ref:`NodePath<class_NodePath>` path **)** |const| |
  111. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  112. | :ref:`Array<class_Array>` | :ref:`get_node_and_resource<class_Node_method_get_node_and_resource>` **(** :ref:`NodePath<class_NodePath>` path **)** |
  113. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  114. | :ref:`Node<class_Node>` | :ref:`get_node_or_null<class_Node_method_get_node_or_null>` **(** :ref:`NodePath<class_NodePath>` path **)** |const| |
  115. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  116. | :ref:`Node<class_Node>` | :ref:`get_parent<class_Node_method_get_parent>` **(** **)** |const| |
  117. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  118. | :ref:`NodePath<class_NodePath>` | :ref:`get_path<class_Node_method_get_path>` **(** **)** |const| |
  119. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  120. | :ref:`NodePath<class_NodePath>` | :ref:`get_path_to<class_Node_method_get_path_to>` **(** :ref:`Node<class_Node>` node, :ref:`bool<class_bool>` use_unique_path=false **)** |const| |
  121. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  122. | :ref:`float<class_float>` | :ref:`get_physics_process_delta_time<class_Node_method_get_physics_process_delta_time>` **(** **)** |const| |
  123. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  124. | :ref:`float<class_float>` | :ref:`get_process_delta_time<class_Node_method_get_process_delta_time>` **(** **)** |const| |
  125. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  126. | :ref:`bool<class_bool>` | :ref:`get_scene_instance_load_placeholder<class_Node_method_get_scene_instance_load_placeholder>` **(** **)** |const| |
  127. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  128. | :ref:`SceneTree<class_SceneTree>` | :ref:`get_tree<class_Node_method_get_tree>` **(** **)** |const| |
  129. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  130. | :ref:`Viewport<class_Viewport>` | :ref:`get_viewport<class_Node_method_get_viewport>` **(** **)** |const| |
  131. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  132. | :ref:`Window<class_Window>` | :ref:`get_window<class_Node_method_get_window>` **(** **)** |const| |
  133. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  134. | :ref:`bool<class_bool>` | :ref:`has_node<class_Node_method_has_node>` **(** :ref:`NodePath<class_NodePath>` path **)** |const| |
  135. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  136. | :ref:`bool<class_bool>` | :ref:`has_node_and_resource<class_Node_method_has_node_and_resource>` **(** :ref:`NodePath<class_NodePath>` path **)** |const| |
  137. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  138. | :ref:`bool<class_bool>` | :ref:`is_ancestor_of<class_Node_method_is_ancestor_of>` **(** :ref:`Node<class_Node>` node **)** |const| |
  139. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  140. | :ref:`bool<class_bool>` | :ref:`is_displayed_folded<class_Node_method_is_displayed_folded>` **(** **)** |const| |
  141. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  142. | :ref:`bool<class_bool>` | :ref:`is_editable_instance<class_Node_method_is_editable_instance>` **(** :ref:`Node<class_Node>` node **)** |const| |
  143. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  144. | :ref:`bool<class_bool>` | :ref:`is_greater_than<class_Node_method_is_greater_than>` **(** :ref:`Node<class_Node>` node **)** |const| |
  145. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  146. | :ref:`bool<class_bool>` | :ref:`is_in_group<class_Node_method_is_in_group>` **(** :ref:`StringName<class_StringName>` group **)** |const| |
  147. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  148. | :ref:`bool<class_bool>` | :ref:`is_inside_tree<class_Node_method_is_inside_tree>` **(** **)** |const| |
  149. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  150. | :ref:`bool<class_bool>` | :ref:`is_multiplayer_authority<class_Node_method_is_multiplayer_authority>` **(** **)** |const| |
  151. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  152. | :ref:`bool<class_bool>` | :ref:`is_physics_processing<class_Node_method_is_physics_processing>` **(** **)** |const| |
  153. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  154. | :ref:`bool<class_bool>` | :ref:`is_physics_processing_internal<class_Node_method_is_physics_processing_internal>` **(** **)** |const| |
  155. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  156. | :ref:`bool<class_bool>` | :ref:`is_processing<class_Node_method_is_processing>` **(** **)** |const| |
  157. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  158. | :ref:`bool<class_bool>` | :ref:`is_processing_input<class_Node_method_is_processing_input>` **(** **)** |const| |
  159. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  160. | :ref:`bool<class_bool>` | :ref:`is_processing_internal<class_Node_method_is_processing_internal>` **(** **)** |const| |
  161. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  162. | :ref:`bool<class_bool>` | :ref:`is_processing_shortcut_input<class_Node_method_is_processing_shortcut_input>` **(** **)** |const| |
  163. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  164. | :ref:`bool<class_bool>` | :ref:`is_processing_unhandled_input<class_Node_method_is_processing_unhandled_input>` **(** **)** |const| |
  165. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  166. | :ref:`bool<class_bool>` | :ref:`is_processing_unhandled_key_input<class_Node_method_is_processing_unhandled_key_input>` **(** **)** |const| |
  167. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  168. | void | :ref:`move_child<class_Node_method_move_child>` **(** :ref:`Node<class_Node>` child_node, :ref:`int<class_int>` to_index **)** |
  169. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  170. | void | :ref:`print_orphan_nodes<class_Node_method_print_orphan_nodes>` **(** **)** |static| |
  171. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  172. | void | :ref:`print_tree<class_Node_method_print_tree>` **(** **)** |
  173. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  174. | void | :ref:`print_tree_pretty<class_Node_method_print_tree_pretty>` **(** **)** |
  175. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  176. | void | :ref:`propagate_call<class_Node_method_propagate_call>` **(** :ref:`StringName<class_StringName>` method, :ref:`Array<class_Array>` args=[], :ref:`bool<class_bool>` parent_first=false **)** |
  177. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  178. | void | :ref:`propagate_notification<class_Node_method_propagate_notification>` **(** :ref:`int<class_int>` what **)** |
  179. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  180. | void | :ref:`queue_free<class_Node_method_queue_free>` **(** **)** |
  181. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  182. | void | :ref:`remove_child<class_Node_method_remove_child>` **(** :ref:`Node<class_Node>` node **)** |
  183. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  184. | void | :ref:`remove_from_group<class_Node_method_remove_from_group>` **(** :ref:`StringName<class_StringName>` group **)** |
  185. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  186. | void | :ref:`reparent<class_Node_method_reparent>` **(** :ref:`Node<class_Node>` new_parent, :ref:`bool<class_bool>` keep_global_transform=true **)** |
  187. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  188. | void | :ref:`replace_by<class_Node_method_replace_by>` **(** :ref:`Node<class_Node>` node, :ref:`bool<class_bool>` keep_groups=false **)** |
  189. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  190. | void | :ref:`request_ready<class_Node_method_request_ready>` **(** **)** |
  191. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  192. | :ref:`Error<enum_@GlobalScope_Error>` | :ref:`rpc<class_Node_method_rpc>` **(** :ref:`StringName<class_StringName>` method, ... **)** |vararg| |
  193. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  194. | void | :ref:`rpc_config<class_Node_method_rpc_config>` **(** :ref:`StringName<class_StringName>` method, :ref:`Variant<class_Variant>` config **)** |
  195. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  196. | :ref:`Error<enum_@GlobalScope_Error>` | :ref:`rpc_id<class_Node_method_rpc_id>` **(** :ref:`int<class_int>` peer_id, :ref:`StringName<class_StringName>` method, ... **)** |vararg| |
  197. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  198. | void | :ref:`set_display_folded<class_Node_method_set_display_folded>` **(** :ref:`bool<class_bool>` fold **)** |
  199. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  200. | void | :ref:`set_editable_instance<class_Node_method_set_editable_instance>` **(** :ref:`Node<class_Node>` node, :ref:`bool<class_bool>` is_editable **)** |
  201. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  202. | void | :ref:`set_multiplayer_authority<class_Node_method_set_multiplayer_authority>` **(** :ref:`int<class_int>` id, :ref:`bool<class_bool>` recursive=true **)** |
  203. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  204. | void | :ref:`set_physics_process<class_Node_method_set_physics_process>` **(** :ref:`bool<class_bool>` enable **)** |
  205. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  206. | void | :ref:`set_physics_process_internal<class_Node_method_set_physics_process_internal>` **(** :ref:`bool<class_bool>` enable **)** |
  207. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  208. | void | :ref:`set_process<class_Node_method_set_process>` **(** :ref:`bool<class_bool>` enable **)** |
  209. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  210. | void | :ref:`set_process_input<class_Node_method_set_process_input>` **(** :ref:`bool<class_bool>` enable **)** |
  211. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  212. | void | :ref:`set_process_internal<class_Node_method_set_process_internal>` **(** :ref:`bool<class_bool>` enable **)** |
  213. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  214. | void | :ref:`set_process_shortcut_input<class_Node_method_set_process_shortcut_input>` **(** :ref:`bool<class_bool>` enable **)** |
  215. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  216. | void | :ref:`set_process_unhandled_input<class_Node_method_set_process_unhandled_input>` **(** :ref:`bool<class_bool>` enable **)** |
  217. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  218. | void | :ref:`set_process_unhandled_key_input<class_Node_method_set_process_unhandled_key_input>` **(** :ref:`bool<class_bool>` enable **)** |
  219. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  220. | void | :ref:`set_scene_instance_load_placeholder<class_Node_method_set_scene_instance_load_placeholder>` **(** :ref:`bool<class_bool>` load_placeholder **)** |
  221. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  222. | void | :ref:`update_configuration_warnings<class_Node_method_update_configuration_warnings>` **(** **)** |
  223. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  224. .. rst-class:: classref-section-separator
  225. ----
  226. .. rst-class:: classref-descriptions-group
  227. Signals
  228. -------
  229. .. _class_Node_signal_child_entered_tree:
  230. .. rst-class:: classref-signal
  231. **child_entered_tree** **(** :ref:`Node<class_Node>` node **)**
  232. Emitted when a child node enters the scene tree, either because it entered on its own or because this node entered with it.
  233. This signal is emitted *after* the child node's own :ref:`NOTIFICATION_ENTER_TREE<class_Node_constant_NOTIFICATION_ENTER_TREE>` and :ref:`tree_entered<class_Node_signal_tree_entered>`.
  234. .. rst-class:: classref-item-separator
  235. ----
  236. .. _class_Node_signal_child_exiting_tree:
  237. .. rst-class:: classref-signal
  238. **child_exiting_tree** **(** :ref:`Node<class_Node>` node **)**
  239. Emitted when a child node is about to exit the scene tree, either because it is being removed or freed directly, or because this node is exiting the tree.
  240. When this signal is received, the child ``node`` is still in the tree and valid. This signal is emitted *after* the child node's own :ref:`tree_exiting<class_Node_signal_tree_exiting>` and :ref:`NOTIFICATION_EXIT_TREE<class_Node_constant_NOTIFICATION_EXIT_TREE>`.
  241. .. rst-class:: classref-item-separator
  242. ----
  243. .. _class_Node_signal_ready:
  244. .. rst-class:: classref-signal
  245. **ready** **(** **)**
  246. Emitted when the node is ready. Comes after :ref:`_ready<class_Node_method__ready>` callback and follows the same rules.
  247. .. rst-class:: classref-item-separator
  248. ----
  249. .. _class_Node_signal_renamed:
  250. .. rst-class:: classref-signal
  251. **renamed** **(** **)**
  252. Emitted when the node is renamed.
  253. .. rst-class:: classref-item-separator
  254. ----
  255. .. _class_Node_signal_tree_entered:
  256. .. rst-class:: classref-signal
  257. **tree_entered** **(** **)**
  258. Emitted when the node enters the tree.
  259. This signal is emitted *after* the related :ref:`NOTIFICATION_ENTER_TREE<class_Node_constant_NOTIFICATION_ENTER_TREE>` notification.
  260. .. rst-class:: classref-item-separator
  261. ----
  262. .. _class_Node_signal_tree_exited:
  263. .. rst-class:: classref-signal
  264. **tree_exited** **(** **)**
  265. Emitted after the node exits the tree and is no longer active.
  266. .. rst-class:: classref-item-separator
  267. ----
  268. .. _class_Node_signal_tree_exiting:
  269. .. rst-class:: classref-signal
  270. **tree_exiting** **(** **)**
  271. Emitted when the node is still active but about to exit the tree. This is the right place for de-initialization (or a "destructor", if you will).
  272. This signal is emitted *before* the related :ref:`NOTIFICATION_EXIT_TREE<class_Node_constant_NOTIFICATION_EXIT_TREE>` notification.
  273. .. rst-class:: classref-section-separator
  274. ----
  275. .. rst-class:: classref-descriptions-group
  276. Enumerations
  277. ------------
  278. .. _enum_Node_ProcessMode:
  279. .. rst-class:: classref-enumeration
  280. enum **ProcessMode**:
  281. .. _class_Node_constant_PROCESS_MODE_INHERIT:
  282. .. rst-class:: classref-enumeration-constant
  283. :ref:`ProcessMode<enum_Node_ProcessMode>` **PROCESS_MODE_INHERIT** = ``0``
  284. Inherits process mode from the node's parent. For the root node, it is equivalent to :ref:`PROCESS_MODE_PAUSABLE<class_Node_constant_PROCESS_MODE_PAUSABLE>`. Default.
  285. .. _class_Node_constant_PROCESS_MODE_PAUSABLE:
  286. .. rst-class:: classref-enumeration-constant
  287. :ref:`ProcessMode<enum_Node_ProcessMode>` **PROCESS_MODE_PAUSABLE** = ``1``
  288. Stops processing when the :ref:`SceneTree<class_SceneTree>` is paused (process when unpaused). This is the inverse of :ref:`PROCESS_MODE_WHEN_PAUSED<class_Node_constant_PROCESS_MODE_WHEN_PAUSED>`.
  289. .. _class_Node_constant_PROCESS_MODE_WHEN_PAUSED:
  290. .. rst-class:: classref-enumeration-constant
  291. :ref:`ProcessMode<enum_Node_ProcessMode>` **PROCESS_MODE_WHEN_PAUSED** = ``2``
  292. Only process when the :ref:`SceneTree<class_SceneTree>` is paused (don't process when unpaused). This is the inverse of :ref:`PROCESS_MODE_PAUSABLE<class_Node_constant_PROCESS_MODE_PAUSABLE>`.
  293. .. _class_Node_constant_PROCESS_MODE_ALWAYS:
  294. .. rst-class:: classref-enumeration-constant
  295. :ref:`ProcessMode<enum_Node_ProcessMode>` **PROCESS_MODE_ALWAYS** = ``3``
  296. Always process. Continue processing always, ignoring the :ref:`SceneTree<class_SceneTree>`'s paused property. This is the inverse of :ref:`PROCESS_MODE_DISABLED<class_Node_constant_PROCESS_MODE_DISABLED>`.
  297. .. _class_Node_constant_PROCESS_MODE_DISABLED:
  298. .. rst-class:: classref-enumeration-constant
  299. :ref:`ProcessMode<enum_Node_ProcessMode>` **PROCESS_MODE_DISABLED** = ``4``
  300. Never process. Completely disables processing, ignoring the :ref:`SceneTree<class_SceneTree>`'s paused property. This is the inverse of :ref:`PROCESS_MODE_ALWAYS<class_Node_constant_PROCESS_MODE_ALWAYS>`.
  301. .. rst-class:: classref-item-separator
  302. ----
  303. .. _enum_Node_DuplicateFlags:
  304. .. rst-class:: classref-enumeration
  305. enum **DuplicateFlags**:
  306. .. _class_Node_constant_DUPLICATE_SIGNALS:
  307. .. rst-class:: classref-enumeration-constant
  308. :ref:`DuplicateFlags<enum_Node_DuplicateFlags>` **DUPLICATE_SIGNALS** = ``1``
  309. Duplicate the node's signals.
  310. .. _class_Node_constant_DUPLICATE_GROUPS:
  311. .. rst-class:: classref-enumeration-constant
  312. :ref:`DuplicateFlags<enum_Node_DuplicateFlags>` **DUPLICATE_GROUPS** = ``2``
  313. Duplicate the node's groups.
  314. .. _class_Node_constant_DUPLICATE_SCRIPTS:
  315. .. rst-class:: classref-enumeration-constant
  316. :ref:`DuplicateFlags<enum_Node_DuplicateFlags>` **DUPLICATE_SCRIPTS** = ``4``
  317. Duplicate the node's scripts.
  318. .. _class_Node_constant_DUPLICATE_USE_INSTANTIATION:
  319. .. rst-class:: classref-enumeration-constant
  320. :ref:`DuplicateFlags<enum_Node_DuplicateFlags>` **DUPLICATE_USE_INSTANTIATION** = ``8``
  321. Duplicate using instancing.
  322. An instance stays linked to the original so when the original changes, the instance changes too.
  323. .. rst-class:: classref-item-separator
  324. ----
  325. .. _enum_Node_InternalMode:
  326. .. rst-class:: classref-enumeration
  327. enum **InternalMode**:
  328. .. _class_Node_constant_INTERNAL_MODE_DISABLED:
  329. .. rst-class:: classref-enumeration-constant
  330. :ref:`InternalMode<enum_Node_InternalMode>` **INTERNAL_MODE_DISABLED** = ``0``
  331. Node will not be internal.
  332. .. _class_Node_constant_INTERNAL_MODE_FRONT:
  333. .. rst-class:: classref-enumeration-constant
  334. :ref:`InternalMode<enum_Node_InternalMode>` **INTERNAL_MODE_FRONT** = ``1``
  335. Node will be placed at the front of parent's node list, before any non-internal sibling.
  336. .. _class_Node_constant_INTERNAL_MODE_BACK:
  337. .. rst-class:: classref-enumeration-constant
  338. :ref:`InternalMode<enum_Node_InternalMode>` **INTERNAL_MODE_BACK** = ``2``
  339. Node will be placed at the back of parent's node list, after any non-internal sibling.
  340. .. rst-class:: classref-section-separator
  341. ----
  342. .. rst-class:: classref-descriptions-group
  343. Constants
  344. ---------
  345. .. _class_Node_constant_NOTIFICATION_ENTER_TREE:
  346. .. rst-class:: classref-constant
  347. **NOTIFICATION_ENTER_TREE** = ``10``
  348. Notification received when the node enters a :ref:`SceneTree<class_SceneTree>`.
  349. This notification is emitted *before* the related :ref:`tree_entered<class_Node_signal_tree_entered>`.
  350. .. _class_Node_constant_NOTIFICATION_EXIT_TREE:
  351. .. rst-class:: classref-constant
  352. **NOTIFICATION_EXIT_TREE** = ``11``
  353. Notification received when the node is about to exit a :ref:`SceneTree<class_SceneTree>`.
  354. This notification is emitted *after* the related :ref:`tree_exiting<class_Node_signal_tree_exiting>`.
  355. .. _class_Node_constant_NOTIFICATION_MOVED_IN_PARENT:
  356. .. rst-class:: classref-constant
  357. **NOTIFICATION_MOVED_IN_PARENT** = ``12``
  358. Notification received when the node is moved in the parent.
  359. .. _class_Node_constant_NOTIFICATION_READY:
  360. .. rst-class:: classref-constant
  361. **NOTIFICATION_READY** = ``13``
  362. Notification received when the node is ready. See :ref:`_ready<class_Node_method__ready>`.
  363. .. _class_Node_constant_NOTIFICATION_PAUSED:
  364. .. rst-class:: classref-constant
  365. **NOTIFICATION_PAUSED** = ``14``
  366. Notification received when the node is paused.
  367. .. _class_Node_constant_NOTIFICATION_UNPAUSED:
  368. .. rst-class:: classref-constant
  369. **NOTIFICATION_UNPAUSED** = ``15``
  370. Notification received when the node is unpaused.
  371. .. _class_Node_constant_NOTIFICATION_PHYSICS_PROCESS:
  372. .. rst-class:: classref-constant
  373. **NOTIFICATION_PHYSICS_PROCESS** = ``16``
  374. Notification received every frame when the physics process flag is set (see :ref:`set_physics_process<class_Node_method_set_physics_process>`).
  375. .. _class_Node_constant_NOTIFICATION_PROCESS:
  376. .. rst-class:: classref-constant
  377. **NOTIFICATION_PROCESS** = ``17``
  378. Notification received every frame when the process flag is set (see :ref:`set_process<class_Node_method_set_process>`).
  379. .. _class_Node_constant_NOTIFICATION_PARENTED:
  380. .. rst-class:: classref-constant
  381. **NOTIFICATION_PARENTED** = ``18``
  382. Notification received when a node is set as a child of another node.
  383. \ **Note:** This doesn't mean that a node entered the :ref:`SceneTree<class_SceneTree>`.
  384. .. _class_Node_constant_NOTIFICATION_UNPARENTED:
  385. .. rst-class:: classref-constant
  386. **NOTIFICATION_UNPARENTED** = ``19``
  387. Notification received when a node is unparented (parent removed it from the list of children).
  388. .. _class_Node_constant_NOTIFICATION_SCENE_INSTANTIATED:
  389. .. rst-class:: classref-constant
  390. **NOTIFICATION_SCENE_INSTANTIATED** = ``20``
  391. Notification received by scene owner when its scene is instantiated.
  392. .. _class_Node_constant_NOTIFICATION_DRAG_BEGIN:
  393. .. rst-class:: classref-constant
  394. **NOTIFICATION_DRAG_BEGIN** = ``21``
  395. Notification received when a drag operation begins. All nodes receive this notification, not only the dragged one.
  396. Can be triggered either by dragging a :ref:`Control<class_Control>` that provides drag data (see :ref:`Control._get_drag_data<class_Control_method__get_drag_data>`) or using :ref:`Control.force_drag<class_Control_method_force_drag>`.
  397. Use :ref:`Viewport.gui_get_drag_data<class_Viewport_method_gui_get_drag_data>` to get the dragged data.
  398. .. _class_Node_constant_NOTIFICATION_DRAG_END:
  399. .. rst-class:: classref-constant
  400. **NOTIFICATION_DRAG_END** = ``22``
  401. Notification received when a drag operation ends.
  402. Use :ref:`Viewport.gui_is_drag_successful<class_Viewport_method_gui_is_drag_successful>` to check if the drag succeeded.
  403. .. _class_Node_constant_NOTIFICATION_PATH_RENAMED:
  404. .. rst-class:: classref-constant
  405. **NOTIFICATION_PATH_RENAMED** = ``23``
  406. Notification received when the node's name or one of its parents' name is changed. This notification is *not* received when the node is removed from the scene tree to be added to another parent later on.
  407. .. _class_Node_constant_NOTIFICATION_INTERNAL_PROCESS:
  408. .. rst-class:: classref-constant
  409. **NOTIFICATION_INTERNAL_PROCESS** = ``25``
  410. Notification received every frame when the internal process flag is set (see :ref:`set_process_internal<class_Node_method_set_process_internal>`).
  411. .. _class_Node_constant_NOTIFICATION_INTERNAL_PHYSICS_PROCESS:
  412. .. rst-class:: classref-constant
  413. **NOTIFICATION_INTERNAL_PHYSICS_PROCESS** = ``26``
  414. Notification received every frame when the internal physics process flag is set (see :ref:`set_physics_process_internal<class_Node_method_set_physics_process_internal>`).
  415. .. _class_Node_constant_NOTIFICATION_POST_ENTER_TREE:
  416. .. rst-class:: classref-constant
  417. **NOTIFICATION_POST_ENTER_TREE** = ``27``
  418. Notification received when the node is ready, just before :ref:`NOTIFICATION_READY<class_Node_constant_NOTIFICATION_READY>` is received. Unlike the latter, it's sent every time the node enters tree, instead of only once.
  419. .. _class_Node_constant_NOTIFICATION_DISABLED:
  420. .. rst-class:: classref-constant
  421. **NOTIFICATION_DISABLED** = ``28``
  422. Notification received when the node is disabled. See :ref:`PROCESS_MODE_DISABLED<class_Node_constant_PROCESS_MODE_DISABLED>`.
  423. .. _class_Node_constant_NOTIFICATION_ENABLED:
  424. .. rst-class:: classref-constant
  425. **NOTIFICATION_ENABLED** = ``29``
  426. Notification received when the node is enabled again after being disabled. See :ref:`PROCESS_MODE_DISABLED<class_Node_constant_PROCESS_MODE_DISABLED>`.
  427. .. _class_Node_constant_NOTIFICATION_NODE_RECACHE_REQUESTED:
  428. .. rst-class:: classref-constant
  429. **NOTIFICATION_NODE_RECACHE_REQUESTED** = ``30``
  430. Notification received when other nodes in the tree may have been removed/replaced and node pointers may require re-caching.
  431. .. _class_Node_constant_NOTIFICATION_EDITOR_PRE_SAVE:
  432. .. rst-class:: classref-constant
  433. **NOTIFICATION_EDITOR_PRE_SAVE** = ``9001``
  434. Notification received right before the scene with the node is saved in the editor. This notification is only sent in the Godot editor and will not occur in exported projects.
  435. .. _class_Node_constant_NOTIFICATION_EDITOR_POST_SAVE:
  436. .. rst-class:: classref-constant
  437. **NOTIFICATION_EDITOR_POST_SAVE** = ``9002``
  438. Notification received right after the scene with the node is saved in the editor. This notification is only sent in the Godot editor and will not occur in exported projects.
  439. .. _class_Node_constant_NOTIFICATION_WM_MOUSE_ENTER:
  440. .. rst-class:: classref-constant
  441. **NOTIFICATION_WM_MOUSE_ENTER** = ``1002``
  442. Notification received from the OS when the mouse enters the game window.
  443. Implemented on desktop and web platforms.
  444. .. _class_Node_constant_NOTIFICATION_WM_MOUSE_EXIT:
  445. .. rst-class:: classref-constant
  446. **NOTIFICATION_WM_MOUSE_EXIT** = ``1003``
  447. Notification received from the OS when the mouse leaves the game window.
  448. Implemented on desktop and web platforms.
  449. .. _class_Node_constant_NOTIFICATION_WM_WINDOW_FOCUS_IN:
  450. .. rst-class:: classref-constant
  451. **NOTIFICATION_WM_WINDOW_FOCUS_IN** = ``1004``
  452. Notification received from the OS when the node's parent :ref:`Window<class_Window>` is focused. This may be a change of focus between two windows of the same engine instance, or from the OS desktop or a third-party application to a window of the game (in which case :ref:`NOTIFICATION_APPLICATION_FOCUS_IN<class_Node_constant_NOTIFICATION_APPLICATION_FOCUS_IN>` is also emitted).
  453. .. _class_Node_constant_NOTIFICATION_WM_WINDOW_FOCUS_OUT:
  454. .. rst-class:: classref-constant
  455. **NOTIFICATION_WM_WINDOW_FOCUS_OUT** = ``1005``
  456. Notification received from the OS when the node's parent :ref:`Window<class_Window>` is defocused. This may be a change of focus between two windows of the same engine instance, or from a window of the game to the OS desktop or a third-party application (in which case :ref:`NOTIFICATION_APPLICATION_FOCUS_OUT<class_Node_constant_NOTIFICATION_APPLICATION_FOCUS_OUT>` is also emitted).
  457. .. _class_Node_constant_NOTIFICATION_WM_CLOSE_REQUEST:
  458. .. rst-class:: classref-constant
  459. **NOTIFICATION_WM_CLOSE_REQUEST** = ``1006``
  460. Notification received from the OS when a close request is sent (e.g. closing the window with a "Close" button or :kbd:`Alt + F4`).
  461. Implemented on desktop platforms.
  462. .. _class_Node_constant_NOTIFICATION_WM_GO_BACK_REQUEST:
  463. .. rst-class:: classref-constant
  464. **NOTIFICATION_WM_GO_BACK_REQUEST** = ``1007``
  465. Notification received from the OS when a go back request is sent (e.g. pressing the "Back" button on Android).
  466. Specific to the Android platform.
  467. .. _class_Node_constant_NOTIFICATION_WM_SIZE_CHANGED:
  468. .. rst-class:: classref-constant
  469. **NOTIFICATION_WM_SIZE_CHANGED** = ``1008``
  470. .. _class_Node_constant_NOTIFICATION_WM_DPI_CHANGE:
  471. .. rst-class:: classref-constant
  472. **NOTIFICATION_WM_DPI_CHANGE** = ``1009``
  473. .. _class_Node_constant_NOTIFICATION_VP_MOUSE_ENTER:
  474. .. rst-class:: classref-constant
  475. **NOTIFICATION_VP_MOUSE_ENTER** = ``1010``
  476. Notification received when the mouse enters the viewport.
  477. .. _class_Node_constant_NOTIFICATION_VP_MOUSE_EXIT:
  478. .. rst-class:: classref-constant
  479. **NOTIFICATION_VP_MOUSE_EXIT** = ``1011``
  480. Notification received when the mouse leaves the viewport.
  481. .. _class_Node_constant_NOTIFICATION_OS_MEMORY_WARNING:
  482. .. rst-class:: classref-constant
  483. **NOTIFICATION_OS_MEMORY_WARNING** = ``2009``
  484. Notification received from the OS when the application is exceeding its allocated memory.
  485. Specific to the iOS platform.
  486. .. _class_Node_constant_NOTIFICATION_TRANSLATION_CHANGED:
  487. .. rst-class:: classref-constant
  488. **NOTIFICATION_TRANSLATION_CHANGED** = ``2010``
  489. Notification received when translations may have changed. Can be triggered by the user changing the locale. Can be used to respond to language changes, for example to change the UI strings on the fly. Useful when working with the built-in translation support, like :ref:`Object.tr<class_Object_method_tr>`.
  490. .. _class_Node_constant_NOTIFICATION_WM_ABOUT:
  491. .. rst-class:: classref-constant
  492. **NOTIFICATION_WM_ABOUT** = ``2011``
  493. Notification received from the OS when a request for "About" information is sent.
  494. Specific to the macOS platform.
  495. .. _class_Node_constant_NOTIFICATION_CRASH:
  496. .. rst-class:: classref-constant
  497. **NOTIFICATION_CRASH** = ``2012``
  498. Notification received from Godot's crash handler when the engine is about to crash.
  499. Implemented on desktop platforms if the crash handler is enabled.
  500. .. _class_Node_constant_NOTIFICATION_OS_IME_UPDATE:
  501. .. rst-class:: classref-constant
  502. **NOTIFICATION_OS_IME_UPDATE** = ``2013``
  503. Notification received from the OS when an update of the Input Method Engine occurs (e.g. change of IME cursor position or composition string).
  504. Specific to the macOS platform.
  505. .. _class_Node_constant_NOTIFICATION_APPLICATION_RESUMED:
  506. .. rst-class:: classref-constant
  507. **NOTIFICATION_APPLICATION_RESUMED** = ``2014``
  508. Notification received from the OS when the application is resumed.
  509. Specific to the Android platform.
  510. .. _class_Node_constant_NOTIFICATION_APPLICATION_PAUSED:
  511. .. rst-class:: classref-constant
  512. **NOTIFICATION_APPLICATION_PAUSED** = ``2015``
  513. Notification received from the OS when the application is paused.
  514. Specific to the Android platform.
  515. .. _class_Node_constant_NOTIFICATION_APPLICATION_FOCUS_IN:
  516. .. rst-class:: classref-constant
  517. **NOTIFICATION_APPLICATION_FOCUS_IN** = ``2016``
  518. Notification received from the OS when the application is focused, i.e. when changing the focus from the OS desktop or a thirdparty application to any open window of the Godot instance.
  519. Implemented on desktop platforms.
  520. .. _class_Node_constant_NOTIFICATION_APPLICATION_FOCUS_OUT:
  521. .. rst-class:: classref-constant
  522. **NOTIFICATION_APPLICATION_FOCUS_OUT** = ``2017``
  523. Notification received from the OS when the application is defocused, i.e. when changing the focus from any open window of the Godot instance to the OS desktop or a thirdparty application.
  524. Implemented on desktop platforms.
  525. .. _class_Node_constant_NOTIFICATION_TEXT_SERVER_CHANGED:
  526. .. rst-class:: classref-constant
  527. **NOTIFICATION_TEXT_SERVER_CHANGED** = ``2018``
  528. Notification received when text server is changed.
  529. .. rst-class:: classref-section-separator
  530. ----
  531. .. rst-class:: classref-descriptions-group
  532. Property Descriptions
  533. ---------------------
  534. .. _class_Node_property_editor_description:
  535. .. rst-class:: classref-property
  536. :ref:`String<class_String>` **editor_description** = ``""``
  537. .. rst-class:: classref-property-setget
  538. - void **set_editor_description** **(** :ref:`String<class_String>` value **)**
  539. - :ref:`String<class_String>` **get_editor_description** **(** **)**
  540. Add a custom description to a node. It will be displayed in a tooltip when hovered in editor's scene tree.
  541. .. rst-class:: classref-item-separator
  542. ----
  543. .. _class_Node_property_multiplayer:
  544. .. rst-class:: classref-property
  545. :ref:`MultiplayerAPI<class_MultiplayerAPI>` **multiplayer**
  546. .. rst-class:: classref-property-setget
  547. - :ref:`MultiplayerAPI<class_MultiplayerAPI>` **get_multiplayer** **(** **)**
  548. The :ref:`MultiplayerAPI<class_MultiplayerAPI>` instance associated with this node. See :ref:`SceneTree.get_multiplayer<class_SceneTree_method_get_multiplayer>`.
  549. .. rst-class:: classref-item-separator
  550. ----
  551. .. _class_Node_property_name:
  552. .. rst-class:: classref-property
  553. :ref:`StringName<class_StringName>` **name**
  554. .. rst-class:: classref-property-setget
  555. - void **set_name** **(** :ref:`StringName<class_StringName>` value **)**
  556. - :ref:`StringName<class_StringName>` **get_name** **(** **)**
  557. The name of the node. This name is unique among the siblings (other child nodes from the same parent). When set to an existing name, the node will be automatically renamed.
  558. \ **Note:** Auto-generated names might include the ``@`` character, which is reserved for unique names when using :ref:`add_child<class_Node_method_add_child>`. When setting the name manually, any ``@`` will be removed.
  559. .. rst-class:: classref-item-separator
  560. ----
  561. .. _class_Node_property_owner:
  562. .. rst-class:: classref-property
  563. :ref:`Node<class_Node>` **owner**
  564. .. rst-class:: classref-property-setget
  565. - void **set_owner** **(** :ref:`Node<class_Node>` value **)**
  566. - :ref:`Node<class_Node>` **get_owner** **(** **)**
  567. The node owner. A node can have any other node as owner (as long as it is a valid parent, grandparent, etc. ascending in the tree). When saving a node (using :ref:`PackedScene<class_PackedScene>`), all the nodes it owns will be saved with it. This allows for the creation of complex :ref:`SceneTree<class_SceneTree>`\ s, with instancing and subinstancing.
  568. \ **Note:** If you want a child to be persisted to a :ref:`PackedScene<class_PackedScene>`, you must set :ref:`owner<class_Node_property_owner>` in addition to calling :ref:`add_child<class_Node_method_add_child>`. This is typically relevant for :doc:`tool scripts <../tutorials/plugins/running_code_in_the_editor>` and :doc:`editor plugins <../tutorials/plugins/editor/index>`. If :ref:`add_child<class_Node_method_add_child>` is called without setting :ref:`owner<class_Node_property_owner>`, the newly added **Node** will not be visible in the scene tree, though it will be visible in the 2D/3D view.
  569. .. rst-class:: classref-item-separator
  570. ----
  571. .. _class_Node_property_process_mode:
  572. .. rst-class:: classref-property
  573. :ref:`ProcessMode<enum_Node_ProcessMode>` **process_mode** = ``0``
  574. .. rst-class:: classref-property-setget
  575. - void **set_process_mode** **(** :ref:`ProcessMode<enum_Node_ProcessMode>` value **)**
  576. - :ref:`ProcessMode<enum_Node_ProcessMode>` **get_process_mode** **(** **)**
  577. Can be used to pause or unpause the node, or make the node paused based on the :ref:`SceneTree<class_SceneTree>`, or make it inherit the process mode from its parent (default).
  578. .. rst-class:: classref-item-separator
  579. ----
  580. .. _class_Node_property_process_priority:
  581. .. rst-class:: classref-property
  582. :ref:`int<class_int>` **process_priority** = ``0``
  583. .. rst-class:: classref-property-setget
  584. - void **set_process_priority** **(** :ref:`int<class_int>` value **)**
  585. - :ref:`int<class_int>` **get_process_priority** **(** **)**
  586. The node's priority in the execution order of the enabled processing callbacks (i.e. :ref:`NOTIFICATION_PROCESS<class_Node_constant_NOTIFICATION_PROCESS>`, :ref:`NOTIFICATION_PHYSICS_PROCESS<class_Node_constant_NOTIFICATION_PHYSICS_PROCESS>` and their internal counterparts). Nodes whose process priority value is *lower* will have their processing callbacks executed first.
  587. .. rst-class:: classref-item-separator
  588. ----
  589. .. _class_Node_property_scene_file_path:
  590. .. rst-class:: classref-property
  591. :ref:`String<class_String>` **scene_file_path**
  592. .. rst-class:: classref-property-setget
  593. - void **set_scene_file_path** **(** :ref:`String<class_String>` value **)**
  594. - :ref:`String<class_String>` **get_scene_file_path** **(** **)**
  595. If a scene is instantiated from a file, its topmost node contains the absolute file path from which it was loaded in :ref:`scene_file_path<class_Node_property_scene_file_path>` (e.g. ``res://levels/1.tscn``). Otherwise, :ref:`scene_file_path<class_Node_property_scene_file_path>` is set to an empty string.
  596. .. rst-class:: classref-item-separator
  597. ----
  598. .. _class_Node_property_unique_name_in_owner:
  599. .. rst-class:: classref-property
  600. :ref:`bool<class_bool>` **unique_name_in_owner** = ``false``
  601. .. rst-class:: classref-property-setget
  602. - void **set_unique_name_in_owner** **(** :ref:`bool<class_bool>` value **)**
  603. - :ref:`bool<class_bool>` **is_unique_name_in_owner** **(** **)**
  604. Sets this node's name as a unique name in its :ref:`owner<class_Node_property_owner>`. This allows the node to be accessed as ``%Name`` instead of the full path, from any node within that scene.
  605. If another node with the same owner already had that name declared as unique, that other node's name will no longer be set as having a unique name.
  606. .. rst-class:: classref-section-separator
  607. ----
  608. .. rst-class:: classref-descriptions-group
  609. Method Descriptions
  610. -------------------
  611. .. _class_Node_method__enter_tree:
  612. .. rst-class:: classref-method
  613. void **_enter_tree** **(** **)** |virtual|
  614. Called when the node enters the :ref:`SceneTree<class_SceneTree>` (e.g. upon instancing, scene changing, or after calling :ref:`add_child<class_Node_method_add_child>` in a script). If the node has children, its :ref:`_enter_tree<class_Node_method__enter_tree>` callback will be called first, and then that of the children.
  615. Corresponds to the :ref:`NOTIFICATION_ENTER_TREE<class_Node_constant_NOTIFICATION_ENTER_TREE>` notification in :ref:`Object._notification<class_Object_method__notification>`.
  616. .. rst-class:: classref-item-separator
  617. ----
  618. .. _class_Node_method__exit_tree:
  619. .. rst-class:: classref-method
  620. void **_exit_tree** **(** **)** |virtual|
  621. Called when the node is about to leave the :ref:`SceneTree<class_SceneTree>` (e.g. upon freeing, scene changing, or after calling :ref:`remove_child<class_Node_method_remove_child>` in a script). If the node has children, its :ref:`_exit_tree<class_Node_method__exit_tree>` callback will be called last, after all its children have left the tree.
  622. Corresponds to the :ref:`NOTIFICATION_EXIT_TREE<class_Node_constant_NOTIFICATION_EXIT_TREE>` notification in :ref:`Object._notification<class_Object_method__notification>` and signal :ref:`tree_exiting<class_Node_signal_tree_exiting>`. To get notified when the node has already left the active tree, connect to the :ref:`tree_exited<class_Node_signal_tree_exited>`.
  623. .. rst-class:: classref-item-separator
  624. ----
  625. .. _class_Node_method__get_configuration_warnings:
  626. .. rst-class:: classref-method
  627. :ref:`PackedStringArray<class_PackedStringArray>` **_get_configuration_warnings** **(** **)** |virtual| |const|
  628. The elements in the array returned from this method are displayed as warnings in the Scene dock if the script that overrides it is a ``tool`` script.
  629. Returning an empty array produces no warnings.
  630. Call :ref:`update_configuration_warnings<class_Node_method_update_configuration_warnings>` when the warnings need to be updated for this node.
  631. .. rst-class:: classref-item-separator
  632. ----
  633. .. _class_Node_method__input:
  634. .. rst-class:: classref-method
  635. void **_input** **(** :ref:`InputEvent<class_InputEvent>` event **)** |virtual|
  636. Called when there is an input event. The input event propagates up through the node tree until a node consumes it.
  637. It is only called if input processing is enabled, which is done automatically if this method is overridden, and can be toggled with :ref:`set_process_input<class_Node_method_set_process_input>`.
  638. To consume the input event and stop it propagating further to other nodes, :ref:`Viewport.set_input_as_handled<class_Viewport_method_set_input_as_handled>` can be called.
  639. For gameplay input, :ref:`_unhandled_input<class_Node_method__unhandled_input>` and :ref:`_unhandled_key_input<class_Node_method__unhandled_key_input>` are usually a better fit as they allow the GUI to intercept the events first.
  640. \ **Note:** This method is only called if the node is present in the scene tree (i.e. if it's not an orphan).
  641. .. rst-class:: classref-item-separator
  642. ----
  643. .. _class_Node_method__physics_process:
  644. .. rst-class:: classref-method
  645. void **_physics_process** **(** :ref:`float<class_float>` delta **)** |virtual|
  646. Called during the physics processing step of the main loop. Physics processing means that the frame rate is synced to the physics, i.e. the ``delta`` variable should be constant. ``delta`` is in seconds.
  647. It is only called if physics processing is enabled, which is done automatically if this method is overridden, and can be toggled with :ref:`set_physics_process<class_Node_method_set_physics_process>`.
  648. Corresponds to the :ref:`NOTIFICATION_PHYSICS_PROCESS<class_Node_constant_NOTIFICATION_PHYSICS_PROCESS>` notification in :ref:`Object._notification<class_Object_method__notification>`.
  649. \ **Note:** This method is only called if the node is present in the scene tree (i.e. if it's not an orphan).
  650. .. rst-class:: classref-item-separator
  651. ----
  652. .. _class_Node_method__process:
  653. .. rst-class:: classref-method
  654. void **_process** **(** :ref:`float<class_float>` delta **)** |virtual|
  655. Called during the processing step of the main loop. Processing happens at every frame and as fast as possible, so the ``delta`` time since the previous frame is not constant. ``delta`` is in seconds.
  656. It is only called if processing is enabled, which is done automatically if this method is overridden, and can be toggled with :ref:`set_process<class_Node_method_set_process>`.
  657. Corresponds to the :ref:`NOTIFICATION_PROCESS<class_Node_constant_NOTIFICATION_PROCESS>` notification in :ref:`Object._notification<class_Object_method__notification>`.
  658. \ **Note:** This method is only called if the node is present in the scene tree (i.e. if it's not an orphan).
  659. .. rst-class:: classref-item-separator
  660. ----
  661. .. _class_Node_method__ready:
  662. .. rst-class:: classref-method
  663. void **_ready** **(** **)** |virtual|
  664. Called when the node is "ready", i.e. when both the node and its children have entered the scene tree. If the node has children, their :ref:`_ready<class_Node_method__ready>` callbacks get triggered first, and the parent node will receive the ready notification afterwards.
  665. Corresponds to the :ref:`NOTIFICATION_READY<class_Node_constant_NOTIFICATION_READY>` notification in :ref:`Object._notification<class_Object_method__notification>`. See also the ``@onready`` annotation for variables.
  666. Usually used for initialization. For even earlier initialization, :ref:`Object._init<class_Object_method__init>` may be used. See also :ref:`_enter_tree<class_Node_method__enter_tree>`.
  667. \ **Note:** :ref:`_ready<class_Node_method__ready>` may be called only once for each node. After removing a node from the scene tree and adding it again, ``_ready`` will not be called a second time. This can be bypassed by requesting another call with :ref:`request_ready<class_Node_method_request_ready>`, which may be called anywhere before adding the node again.
  668. .. rst-class:: classref-item-separator
  669. ----
  670. .. _class_Node_method__shortcut_input:
  671. .. rst-class:: classref-method
  672. void **_shortcut_input** **(** :ref:`InputEvent<class_InputEvent>` event **)** |virtual|
  673. Called when an :ref:`InputEventKey<class_InputEventKey>` or :ref:`InputEventShortcut<class_InputEventShortcut>` hasn't been consumed by :ref:`_input<class_Node_method__input>` or any GUI :ref:`Control<class_Control>` item. The input event propagates up through the node tree until a node consumes it.
  674. It is only called if shortcut processing is enabled, which is done automatically if this method is overridden, and can be toggled with :ref:`set_process_shortcut_input<class_Node_method_set_process_shortcut_input>`.
  675. To consume the input event and stop it propagating further to other nodes, :ref:`Viewport.set_input_as_handled<class_Viewport_method_set_input_as_handled>` can be called.
  676. This method can be used to handle shortcuts.
  677. \ **Note:** This method is only called if the node is present in the scene tree (i.e. if it's not orphan).
  678. .. rst-class:: classref-item-separator
  679. ----
  680. .. _class_Node_method__unhandled_input:
  681. .. rst-class:: classref-method
  682. void **_unhandled_input** **(** :ref:`InputEvent<class_InputEvent>` event **)** |virtual|
  683. Called when an :ref:`InputEvent<class_InputEvent>` hasn't been consumed by :ref:`_input<class_Node_method__input>` or any GUI :ref:`Control<class_Control>` item. The input event propagates up through the node tree until a node consumes it.
  684. It is only called if unhandled input processing is enabled, which is done automatically if this method is overridden, and can be toggled with :ref:`set_process_unhandled_input<class_Node_method_set_process_unhandled_input>`.
  685. To consume the input event and stop it propagating further to other nodes, :ref:`Viewport.set_input_as_handled<class_Viewport_method_set_input_as_handled>` can be called.
  686. For gameplay input, this and :ref:`_unhandled_key_input<class_Node_method__unhandled_key_input>` are usually a better fit than :ref:`_input<class_Node_method__input>` as they allow the GUI to intercept the events first.
  687. \ **Note:** This method is only called if the node is present in the scene tree (i.e. if it's not an orphan).
  688. .. rst-class:: classref-item-separator
  689. ----
  690. .. _class_Node_method__unhandled_key_input:
  691. .. rst-class:: classref-method
  692. void **_unhandled_key_input** **(** :ref:`InputEvent<class_InputEvent>` event **)** |virtual|
  693. Called when an :ref:`InputEventKey<class_InputEventKey>` hasn't been consumed by :ref:`_input<class_Node_method__input>` or any GUI :ref:`Control<class_Control>` item. The input event propagates up through the node tree until a node consumes it.
  694. It is only called if unhandled key input processing is enabled, which is done automatically if this method is overridden, and can be toggled with :ref:`set_process_unhandled_key_input<class_Node_method_set_process_unhandled_key_input>`.
  695. To consume the input event and stop it propagating further to other nodes, :ref:`Viewport.set_input_as_handled<class_Viewport_method_set_input_as_handled>` can be called.
  696. This method can be used to handle Unicode character input with :kbd:`Alt`, :kbd:`Alt + Ctrl`, and :kbd:`Alt + Shift` modifiers, after shortcuts were handled.
  697. For gameplay input, this and :ref:`_unhandled_input<class_Node_method__unhandled_input>` are usually a better fit than :ref:`_input<class_Node_method__input>` as they allow the GUI to intercept the events first.
  698. This method also performs better than :ref:`_unhandled_input<class_Node_method__unhandled_input>`, since unrelated events such as :ref:`InputEventMouseMotion<class_InputEventMouseMotion>` are automatically filtered.
  699. \ **Note:** This method is only called if the node is present in the scene tree (i.e. if it's not an orphan).
  700. .. rst-class:: classref-item-separator
  701. ----
  702. .. _class_Node_method_add_child:
  703. .. rst-class:: classref-method
  704. void **add_child** **(** :ref:`Node<class_Node>` node, :ref:`bool<class_bool>` force_readable_name=false, :ref:`InternalMode<enum_Node_InternalMode>` internal=0 **)**
  705. Adds a child ``node``. Nodes can have any number of children, but every child must have a unique name. Child nodes are automatically deleted when the parent node is deleted, so an entire scene can be removed by deleting its topmost node.
  706. If ``force_readable_name`` is ``true``, improves the readability of the added ``node``. If not named, the ``node`` is renamed to its type, and if it shares :ref:`name<class_Node_property_name>` with a sibling, a number is suffixed more appropriately. This operation is very slow. As such, it is recommended leaving this to ``false``, which assigns a dummy name featuring ``@`` in both situations.
  707. If ``internal`` is different than :ref:`INTERNAL_MODE_DISABLED<class_Node_constant_INTERNAL_MODE_DISABLED>`, the child will be added as internal node. Such nodes are ignored by methods like :ref:`get_children<class_Node_method_get_children>`, unless their parameter ``include_internal`` is ``true``.The intended usage is to hide the internal nodes from the user, so the user won't accidentally delete or modify them. Used by some GUI nodes, e.g. :ref:`ColorPicker<class_ColorPicker>`. See :ref:`InternalMode<enum_Node_InternalMode>` for available modes.
  708. \ **Note:** If the child node already has a parent, the function will fail. Use :ref:`remove_child<class_Node_method_remove_child>` first to remove the node from its current parent. For example:
  709. .. tabs::
  710. .. code-tab:: gdscript
  711. var child_node = get_child(0)
  712. if child_node.get_parent():
  713. child_node.get_parent().remove_child(child_node)
  714. add_child(child_node)
  715. .. code-tab:: csharp
  716. Node childNode = GetChild(0);
  717. if (childNode.GetParent() != null)
  718. {
  719. childNode.GetParent().RemoveChild(childNode);
  720. }
  721. AddChild(childNode);
  722. If you need the child node to be added below a specific node in the list of children, use :ref:`add_sibling<class_Node_method_add_sibling>` instead of this method.
  723. \ **Note:** If you want a child to be persisted to a :ref:`PackedScene<class_PackedScene>`, you must set :ref:`owner<class_Node_property_owner>` in addition to calling :ref:`add_child<class_Node_method_add_child>`. This is typically relevant for :doc:`tool scripts <../tutorials/plugins/running_code_in_the_editor>` and :doc:`editor plugins <../tutorials/plugins/editor/index>`. If :ref:`add_child<class_Node_method_add_child>` is called without setting :ref:`owner<class_Node_property_owner>`, the newly added **Node** will not be visible in the scene tree, though it will be visible in the 2D/3D view.
  724. .. rst-class:: classref-item-separator
  725. ----
  726. .. _class_Node_method_add_sibling:
  727. .. rst-class:: classref-method
  728. void **add_sibling** **(** :ref:`Node<class_Node>` sibling, :ref:`bool<class_bool>` force_readable_name=false **)**
  729. Adds a ``sibling`` node to current's node parent, at the same level as that node, right below it.
  730. If ``force_readable_name`` is ``true``, improves the readability of the added ``sibling``. If not named, the ``sibling`` is renamed to its type, and if it shares :ref:`name<class_Node_property_name>` with a sibling, a number is suffixed more appropriately. This operation is very slow. As such, it is recommended leaving this to ``false``, which assigns a dummy name featuring ``@`` in both situations.
  731. Use :ref:`add_child<class_Node_method_add_child>` instead of this method if you don't need the child node to be added below a specific node in the list of children.
  732. \ **Note:** If this node is internal, the new sibling will be internal too (see ``internal`` parameter in :ref:`add_child<class_Node_method_add_child>`).
  733. .. rst-class:: classref-item-separator
  734. ----
  735. .. _class_Node_method_add_to_group:
  736. .. rst-class:: classref-method
  737. void **add_to_group** **(** :ref:`StringName<class_StringName>` group, :ref:`bool<class_bool>` persistent=false **)**
  738. Adds the node to a group. Groups are helpers to name and organize a subset of nodes, for example "enemies" or "collectables". A node can be in any number of groups. Nodes can be assigned a group at any time, but will not be added until they are inside the scene tree (see :ref:`is_inside_tree<class_Node_method_is_inside_tree>`). See notes in the description, and the group methods in :ref:`SceneTree<class_SceneTree>`.
  739. The ``persistent`` option is used when packing node to :ref:`PackedScene<class_PackedScene>` and saving to file. Non-persistent groups aren't stored.
  740. \ **Note:** For performance reasons, the order of node groups is *not* guaranteed. The order of node groups should not be relied upon as it can vary across project runs.
  741. .. rst-class:: classref-item-separator
  742. ----
  743. .. _class_Node_method_can_process:
  744. .. rst-class:: classref-method
  745. :ref:`bool<class_bool>` **can_process** **(** **)** |const|
  746. Returns ``true`` if the node can process while the scene tree is paused (see :ref:`process_mode<class_Node_property_process_mode>`). Always returns ``true`` if the scene tree is not paused, and ``false`` if the node is not in the tree.
  747. .. rst-class:: classref-item-separator
  748. ----
  749. .. _class_Node_method_create_tween:
  750. .. rst-class:: classref-method
  751. :ref:`Tween<class_Tween>` **create_tween** **(** **)**
  752. Creates a new :ref:`Tween<class_Tween>` and binds it to this node. This is equivalent of doing:
  753. .. tabs::
  754. .. code-tab:: gdscript
  755. get_tree().create_tween().bind_node(self)
  756. .. code-tab:: csharp
  757. GetTree().CreateTween().BindNode(this);
  758. .. rst-class:: classref-item-separator
  759. ----
  760. .. _class_Node_method_duplicate:
  761. .. rst-class:: classref-method
  762. :ref:`Node<class_Node>` **duplicate** **(** :ref:`int<class_int>` flags=15 **)** |const|
  763. Duplicates the node, returning a new node.
  764. You can fine-tune the behavior using the ``flags`` (see :ref:`DuplicateFlags<enum_Node_DuplicateFlags>`).
  765. \ **Note:** It will not work properly if the node contains a script with constructor arguments (i.e. needs to supply arguments to :ref:`Object._init<class_Object_method__init>` method). In that case, the node will be duplicated without a script.
  766. .. rst-class:: classref-item-separator
  767. ----
  768. .. _class_Node_method_find_child:
  769. .. rst-class:: classref-method
  770. :ref:`Node<class_Node>` **find_child** **(** :ref:`String<class_String>` pattern, :ref:`bool<class_bool>` recursive=true, :ref:`bool<class_bool>` owned=true **)** |const|
  771. Finds the first descendant of this node whose name matches ``pattern`` as in :ref:`String.match<class_String_method_match>`.
  772. \ ``pattern`` does not match against the full path, just against individual node names. It is case-sensitive, with ``"*"`` matching zero or more characters and ``"?"`` matching any single character except ``"."``).
  773. If ``recursive`` is ``true``, all child nodes are included, even if deeply nested. Nodes are checked in tree order, so this node's first direct child is checked first, then its own direct children, etc., before moving to the second direct child, and so on. If ``recursive`` is ``false``, only this node's direct children are matched.
  774. If ``owned`` is ``true``, this method only finds nodes who have an assigned :ref:`owner<class_Node_property_owner>`. This is especially important for scenes instantiated through a script, because those scenes don't have an owner.
  775. Returns ``null`` if no matching **Node** is found.
  776. \ **Note:** As this method walks through all the descendants of the node, it is the slowest way to get a reference to another node. Whenever possible, consider using :ref:`get_node<class_Node_method_get_node>` with unique names instead (see :ref:`unique_name_in_owner<class_Node_property_unique_name_in_owner>`), or caching the node references into variable.
  777. \ **Note:** To find all descendant nodes matching a pattern or a class type, see :ref:`find_children<class_Node_method_find_children>`.
  778. .. rst-class:: classref-item-separator
  779. ----
  780. .. _class_Node_method_find_children:
  781. .. rst-class:: classref-method
  782. :ref:`Node[]<class_Node>` **find_children** **(** :ref:`String<class_String>` pattern, :ref:`String<class_String>` type="", :ref:`bool<class_bool>` recursive=true, :ref:`bool<class_bool>` owned=true **)** |const|
  783. Finds descendants of this node whose name matches ``pattern`` as in :ref:`String.match<class_String_method_match>`, and/or type matches ``type`` as in :ref:`Object.is_class<class_Object_method_is_class>`.
  784. \ ``pattern`` does not match against the full path, just against individual node names. It is case-sensitive, with ``"*"`` matching zero or more characters and ``"?"`` matching any single character except ``"."``).
  785. \ ``type`` will check equality or inheritance, and is case-sensitive. ``"Object"`` will match a node whose type is ``"Node"`` but not the other way around.
  786. If ``recursive`` is ``true``, all child nodes are included, even if deeply nested. Nodes are checked in tree order, so this node's first direct child is checked first, then its own direct children, etc., before moving to the second direct child, and so on. If ``recursive`` is ``false``, only this node's direct children are matched.
  787. If ``owned`` is ``true``, this method only finds nodes who have an assigned :ref:`owner<class_Node_property_owner>`. This is especially important for scenes instantiated through a script, because those scenes don't have an owner.
  788. Returns an empty array if no matching nodes are found.
  789. \ **Note:** As this method walks through all the descendants of the node, it is the slowest way to get references to other nodes. Whenever possible, consider caching the node references into variables.
  790. \ **Note:** If you only want to find the first descendant node that matches a pattern, see :ref:`find_child<class_Node_method_find_child>`.
  791. .. rst-class:: classref-item-separator
  792. ----
  793. .. _class_Node_method_find_parent:
  794. .. rst-class:: classref-method
  795. :ref:`Node<class_Node>` **find_parent** **(** :ref:`String<class_String>` pattern **)** |const|
  796. Finds the first parent of the current node whose name matches ``pattern`` as in :ref:`String.match<class_String_method_match>`.
  797. \ ``pattern`` does not match against the full path, just against individual node names. It is case-sensitive, with ``"*"`` matching zero or more characters and ``"?"`` matching any single character except ``"."``).
  798. \ **Note:** As this method walks upwards in the scene tree, it can be slow in large, deeply nested scene trees. Whenever possible, consider using :ref:`get_node<class_Node_method_get_node>` with unique names instead (see :ref:`unique_name_in_owner<class_Node_property_unique_name_in_owner>`), or caching the node references into variable.
  799. .. rst-class:: classref-item-separator
  800. ----
  801. .. _class_Node_method_get_child:
  802. .. rst-class:: classref-method
  803. :ref:`Node<class_Node>` **get_child** **(** :ref:`int<class_int>` idx, :ref:`bool<class_bool>` include_internal=false **)** |const|
  804. Returns a child node by its index (see :ref:`get_child_count<class_Node_method_get_child_count>`). This method is often used for iterating all children of a node.
  805. Negative indices access the children from the last one.
  806. If ``include_internal`` is ``false``, internal children are skipped (see ``internal`` parameter in :ref:`add_child<class_Node_method_add_child>`).
  807. To access a child node via its name, use :ref:`get_node<class_Node_method_get_node>`.
  808. .. rst-class:: classref-item-separator
  809. ----
  810. .. _class_Node_method_get_child_count:
  811. .. rst-class:: classref-method
  812. :ref:`int<class_int>` **get_child_count** **(** :ref:`bool<class_bool>` include_internal=false **)** |const|
  813. Returns the number of child nodes.
  814. If ``include_internal`` is ``false``, internal children aren't counted (see ``internal`` parameter in :ref:`add_child<class_Node_method_add_child>`).
  815. .. rst-class:: classref-item-separator
  816. ----
  817. .. _class_Node_method_get_children:
  818. .. rst-class:: classref-method
  819. :ref:`Node[]<class_Node>` **get_children** **(** :ref:`bool<class_bool>` include_internal=false **)** |const|
  820. Returns an array of references to node's children.
  821. If ``include_internal`` is ``false``, the returned array won't include internal children (see ``internal`` parameter in :ref:`add_child<class_Node_method_add_child>`).
  822. .. rst-class:: classref-item-separator
  823. ----
  824. .. _class_Node_method_get_groups:
  825. .. rst-class:: classref-method
  826. :ref:`StringName[]<class_StringName>` **get_groups** **(** **)** |const|
  827. Returns an array listing the groups that the node is a member of.
  828. \ **Note:** For performance reasons, the order of node groups is *not* guaranteed. The order of node groups should not be relied upon as it can vary across project runs.
  829. \ **Note:** The engine uses some group names internally (all starting with an underscore). To avoid conflicts with internal groups, do not add custom groups whose name starts with an underscore. To exclude internal groups while looping over :ref:`get_groups<class_Node_method_get_groups>`, use the following snippet:
  830. .. tabs::
  831. .. code-tab:: gdscript
  832. # Stores the node's non-internal groups only (as an array of Strings).
  833. var non_internal_groups = []
  834. for group in get_groups():
  835. if not group.begins_with("_"):
  836. non_internal_groups.push_back(group)
  837. .. code-tab:: csharp
  838. // Stores the node's non-internal groups only (as a List of strings).
  839. List<string> nonInternalGroups = new List<string>();
  840. foreach (string group in GetGroups())
  841. {
  842. if (!group.BeginsWith("_"))
  843. nonInternalGroups.Add(group);
  844. }
  845. .. rst-class:: classref-item-separator
  846. ----
  847. .. _class_Node_method_get_index:
  848. .. rst-class:: classref-method
  849. :ref:`int<class_int>` **get_index** **(** :ref:`bool<class_bool>` include_internal=false **)** |const|
  850. Returns the node's order in the scene tree branch. For example, if called on the first child node the position is ``0``.
  851. If ``include_internal`` is ``false``, the index won't take internal children into account, i.e. first non-internal child will have index of 0 (see ``internal`` parameter in :ref:`add_child<class_Node_method_add_child>`).
  852. .. rst-class:: classref-item-separator
  853. ----
  854. .. _class_Node_method_get_multiplayer_authority:
  855. .. rst-class:: classref-method
  856. :ref:`int<class_int>` **get_multiplayer_authority** **(** **)** |const|
  857. Returns the peer ID of the multiplayer authority for this node. See :ref:`set_multiplayer_authority<class_Node_method_set_multiplayer_authority>`.
  858. .. rst-class:: classref-item-separator
  859. ----
  860. .. _class_Node_method_get_node:
  861. .. rst-class:: classref-method
  862. :ref:`Node<class_Node>` **get_node** **(** :ref:`NodePath<class_NodePath>` path **)** |const|
  863. Fetches a node. The :ref:`NodePath<class_NodePath>` can be either a relative path (from the current node) or an absolute path (in the scene tree) to a node. If the path does not exist, ``null`` is returned and an error is logged. Attempts to access methods on the return value will result in an "Attempt to call <method> on a null instance." error.
  864. \ **Note:** Fetching absolute paths only works when the node is inside the scene tree (see :ref:`is_inside_tree<class_Node_method_is_inside_tree>`).
  865. \ **Example:** Assume your current node is Character and the following tree:
  866. ::
  867. /root
  868. /root/Character
  869. /root/Character/Sword
  870. /root/Character/Backpack/Dagger
  871. /root/MyGame
  872. /root/Swamp/Alligator
  873. /root/Swamp/Mosquito
  874. /root/Swamp/Goblin
  875. Possible paths are:
  876. .. tabs::
  877. .. code-tab:: gdscript
  878. get_node("Sword")
  879. get_node("Backpack/Dagger")
  880. get_node("../Swamp/Alligator")
  881. get_node("/root/MyGame")
  882. .. code-tab:: csharp
  883. GetNode("Sword");
  884. GetNode("Backpack/Dagger");
  885. GetNode("../Swamp/Alligator");
  886. GetNode("/root/MyGame");
  887. .. rst-class:: classref-item-separator
  888. ----
  889. .. _class_Node_method_get_node_and_resource:
  890. .. rst-class:: classref-method
  891. :ref:`Array<class_Array>` **get_node_and_resource** **(** :ref:`NodePath<class_NodePath>` path **)**
  892. Fetches a node and one of its resources as specified by the :ref:`NodePath<class_NodePath>`'s subname (e.g. ``Area2D/CollisionShape2D:shape``). If several nested resources are specified in the :ref:`NodePath<class_NodePath>`, the last one will be fetched.
  893. The return value is an array of size 3: the first index points to the **Node** (or ``null`` if not found), the second index points to the :ref:`Resource<class_Resource>` (or ``null`` if not found), and the third index is the remaining :ref:`NodePath<class_NodePath>`, if any.
  894. For example, assuming that ``Area2D/CollisionShape2D`` is a valid node and that its ``shape`` property has been assigned a :ref:`RectangleShape2D<class_RectangleShape2D>` resource, one could have this kind of output:
  895. .. tabs::
  896. .. code-tab:: gdscript
  897. print(get_node_and_resource("Area2D/CollisionShape2D")) # [[CollisionShape2D:1161], Null, ]
  898. print(get_node_and_resource("Area2D/CollisionShape2D:shape")) # [[CollisionShape2D:1161], [RectangleShape2D:1156], ]
  899. print(get_node_and_resource("Area2D/CollisionShape2D:shape:extents")) # [[CollisionShape2D:1161], [RectangleShape2D:1156], :extents]
  900. .. code-tab:: csharp
  901. GD.Print(GetNodeAndResource("Area2D/CollisionShape2D")); // [[CollisionShape2D:1161], Null, ]
  902. GD.Print(GetNodeAndResource("Area2D/CollisionShape2D:shape")); // [[CollisionShape2D:1161], [RectangleShape2D:1156], ]
  903. GD.Print(GetNodeAndResource("Area2D/CollisionShape2D:shape:extents")); // [[CollisionShape2D:1161], [RectangleShape2D:1156], :extents]
  904. .. rst-class:: classref-item-separator
  905. ----
  906. .. _class_Node_method_get_node_or_null:
  907. .. rst-class:: classref-method
  908. :ref:`Node<class_Node>` **get_node_or_null** **(** :ref:`NodePath<class_NodePath>` path **)** |const|
  909. Similar to :ref:`get_node<class_Node_method_get_node>`, but does not log an error if ``path`` does not point to a valid **Node**.
  910. .. rst-class:: classref-item-separator
  911. ----
  912. .. _class_Node_method_get_parent:
  913. .. rst-class:: classref-method
  914. :ref:`Node<class_Node>` **get_parent** **(** **)** |const|
  915. Returns the parent node of the current node, or ``null`` if the node lacks a parent.
  916. .. rst-class:: classref-item-separator
  917. ----
  918. .. _class_Node_method_get_path:
  919. .. rst-class:: classref-method
  920. :ref:`NodePath<class_NodePath>` **get_path** **(** **)** |const|
  921. Returns the absolute path of the current node. This only works if the current node is inside the scene tree (see :ref:`is_inside_tree<class_Node_method_is_inside_tree>`).
  922. .. rst-class:: classref-item-separator
  923. ----
  924. .. _class_Node_method_get_path_to:
  925. .. rst-class:: classref-method
  926. :ref:`NodePath<class_NodePath>` **get_path_to** **(** :ref:`Node<class_Node>` node, :ref:`bool<class_bool>` use_unique_path=false **)** |const|
  927. Returns the relative :ref:`NodePath<class_NodePath>` from this node to the specified ``node``. Both nodes must be in the same scene or the function will fail.
  928. If ``use_unique_path`` is ``true``, returns the shortest path considering unique node.
  929. \ **Note:** If you get a relative path which starts from a unique node, the path may be longer than a normal relative path due to the addition of the unique node's name.
  930. .. rst-class:: classref-item-separator
  931. ----
  932. .. _class_Node_method_get_physics_process_delta_time:
  933. .. rst-class:: classref-method
  934. :ref:`float<class_float>` **get_physics_process_delta_time** **(** **)** |const|
  935. Returns the time elapsed (in seconds) since the last physics-bound frame (see :ref:`_physics_process<class_Node_method__physics_process>`). This is always a constant value in physics processing unless the frames per second is changed via :ref:`Engine.physics_ticks_per_second<class_Engine_property_physics_ticks_per_second>`.
  936. .. rst-class:: classref-item-separator
  937. ----
  938. .. _class_Node_method_get_process_delta_time:
  939. .. rst-class:: classref-method
  940. :ref:`float<class_float>` **get_process_delta_time** **(** **)** |const|
  941. Returns the time elapsed (in seconds) since the last process callback. This value may vary from frame to frame.
  942. .. rst-class:: classref-item-separator
  943. ----
  944. .. _class_Node_method_get_scene_instance_load_placeholder:
  945. .. rst-class:: classref-method
  946. :ref:`bool<class_bool>` **get_scene_instance_load_placeholder** **(** **)** |const|
  947. Returns ``true`` if this is an instance load placeholder. See :ref:`InstancePlaceholder<class_InstancePlaceholder>`.
  948. .. rst-class:: classref-item-separator
  949. ----
  950. .. _class_Node_method_get_tree:
  951. .. rst-class:: classref-method
  952. :ref:`SceneTree<class_SceneTree>` **get_tree** **(** **)** |const|
  953. Returns the :ref:`SceneTree<class_SceneTree>` that contains this node.
  954. .. rst-class:: classref-item-separator
  955. ----
  956. .. _class_Node_method_get_viewport:
  957. .. rst-class:: classref-method
  958. :ref:`Viewport<class_Viewport>` **get_viewport** **(** **)** |const|
  959. Returns the node's :ref:`Viewport<class_Viewport>`.
  960. .. rst-class:: classref-item-separator
  961. ----
  962. .. _class_Node_method_get_window:
  963. .. rst-class:: classref-method
  964. :ref:`Window<class_Window>` **get_window** **(** **)** |const|
  965. Returns the :ref:`Window<class_Window>` that contains this node. If the node is in the main window, this is equivalent to getting the root node (``get_tree().get_root()``).
  966. .. rst-class:: classref-item-separator
  967. ----
  968. .. _class_Node_method_has_node:
  969. .. rst-class:: classref-method
  970. :ref:`bool<class_bool>` **has_node** **(** :ref:`NodePath<class_NodePath>` path **)** |const|
  971. Returns ``true`` if the node that the :ref:`NodePath<class_NodePath>` points to exists.
  972. .. rst-class:: classref-item-separator
  973. ----
  974. .. _class_Node_method_has_node_and_resource:
  975. .. rst-class:: classref-method
  976. :ref:`bool<class_bool>` **has_node_and_resource** **(** :ref:`NodePath<class_NodePath>` path **)** |const|
  977. Returns ``true`` if the :ref:`NodePath<class_NodePath>` points to a valid node and its subname points to a valid resource, e.g. ``Area2D/CollisionShape2D:shape``. Properties with a non-:ref:`Resource<class_Resource>` type (e.g. nodes or primitive math types) are not considered resources.
  978. .. rst-class:: classref-item-separator
  979. ----
  980. .. _class_Node_method_is_ancestor_of:
  981. .. rst-class:: classref-method
  982. :ref:`bool<class_bool>` **is_ancestor_of** **(** :ref:`Node<class_Node>` node **)** |const|
  983. Returns ``true`` if the given node is a direct or indirect child of the current node.
  984. .. rst-class:: classref-item-separator
  985. ----
  986. .. _class_Node_method_is_displayed_folded:
  987. .. rst-class:: classref-method
  988. :ref:`bool<class_bool>` **is_displayed_folded** **(** **)** |const|
  989. Returns ``true`` if the node is folded (collapsed) in the Scene dock. This method is only intended for use with editor tooling.
  990. .. rst-class:: classref-item-separator
  991. ----
  992. .. _class_Node_method_is_editable_instance:
  993. .. rst-class:: classref-method
  994. :ref:`bool<class_bool>` **is_editable_instance** **(** :ref:`Node<class_Node>` node **)** |const|
  995. Returns ``true`` if ``node`` has editable children enabled relative to this node. This method is only intended for use with editor tooling.
  996. .. rst-class:: classref-item-separator
  997. ----
  998. .. _class_Node_method_is_greater_than:
  999. .. rst-class:: classref-method
  1000. :ref:`bool<class_bool>` **is_greater_than** **(** :ref:`Node<class_Node>` node **)** |const|
  1001. Returns ``true`` if the given node occurs later in the scene hierarchy than the current node.
  1002. .. rst-class:: classref-item-separator
  1003. ----
  1004. .. _class_Node_method_is_in_group:
  1005. .. rst-class:: classref-method
  1006. :ref:`bool<class_bool>` **is_in_group** **(** :ref:`StringName<class_StringName>` group **)** |const|
  1007. Returns ``true`` if this node is in the specified group. See notes in the description, and the group methods in :ref:`SceneTree<class_SceneTree>`.
  1008. .. rst-class:: classref-item-separator
  1009. ----
  1010. .. _class_Node_method_is_inside_tree:
  1011. .. rst-class:: classref-method
  1012. :ref:`bool<class_bool>` **is_inside_tree** **(** **)** |const|
  1013. Returns ``true`` if this node is currently inside a :ref:`SceneTree<class_SceneTree>`.
  1014. .. rst-class:: classref-item-separator
  1015. ----
  1016. .. _class_Node_method_is_multiplayer_authority:
  1017. .. rst-class:: classref-method
  1018. :ref:`bool<class_bool>` **is_multiplayer_authority** **(** **)** |const|
  1019. Returns ``true`` if the local system is the multiplayer authority of this node.
  1020. .. rst-class:: classref-item-separator
  1021. ----
  1022. .. _class_Node_method_is_physics_processing:
  1023. .. rst-class:: classref-method
  1024. :ref:`bool<class_bool>` **is_physics_processing** **(** **)** |const|
  1025. Returns ``true`` if physics processing is enabled (see :ref:`set_physics_process<class_Node_method_set_physics_process>`).
  1026. .. rst-class:: classref-item-separator
  1027. ----
  1028. .. _class_Node_method_is_physics_processing_internal:
  1029. .. rst-class:: classref-method
  1030. :ref:`bool<class_bool>` **is_physics_processing_internal** **(** **)** |const|
  1031. Returns ``true`` if internal physics processing is enabled (see :ref:`set_physics_process_internal<class_Node_method_set_physics_process_internal>`).
  1032. .. rst-class:: classref-item-separator
  1033. ----
  1034. .. _class_Node_method_is_processing:
  1035. .. rst-class:: classref-method
  1036. :ref:`bool<class_bool>` **is_processing** **(** **)** |const|
  1037. Returns ``true`` if processing is enabled (see :ref:`set_process<class_Node_method_set_process>`).
  1038. .. rst-class:: classref-item-separator
  1039. ----
  1040. .. _class_Node_method_is_processing_input:
  1041. .. rst-class:: classref-method
  1042. :ref:`bool<class_bool>` **is_processing_input** **(** **)** |const|
  1043. Returns ``true`` if the node is processing input (see :ref:`set_process_input<class_Node_method_set_process_input>`).
  1044. .. rst-class:: classref-item-separator
  1045. ----
  1046. .. _class_Node_method_is_processing_internal:
  1047. .. rst-class:: classref-method
  1048. :ref:`bool<class_bool>` **is_processing_internal** **(** **)** |const|
  1049. Returns ``true`` if internal processing is enabled (see :ref:`set_process_internal<class_Node_method_set_process_internal>`).
  1050. .. rst-class:: classref-item-separator
  1051. ----
  1052. .. _class_Node_method_is_processing_shortcut_input:
  1053. .. rst-class:: classref-method
  1054. :ref:`bool<class_bool>` **is_processing_shortcut_input** **(** **)** |const|
  1055. Returns ``true`` if the node is processing shortcuts (see :ref:`set_process_shortcut_input<class_Node_method_set_process_shortcut_input>`).
  1056. .. rst-class:: classref-item-separator
  1057. ----
  1058. .. _class_Node_method_is_processing_unhandled_input:
  1059. .. rst-class:: classref-method
  1060. :ref:`bool<class_bool>` **is_processing_unhandled_input** **(** **)** |const|
  1061. Returns ``true`` if the node is processing unhandled input (see :ref:`set_process_unhandled_input<class_Node_method_set_process_unhandled_input>`).
  1062. .. rst-class:: classref-item-separator
  1063. ----
  1064. .. _class_Node_method_is_processing_unhandled_key_input:
  1065. .. rst-class:: classref-method
  1066. :ref:`bool<class_bool>` **is_processing_unhandled_key_input** **(** **)** |const|
  1067. Returns ``true`` if the node is processing unhandled key input (see :ref:`set_process_unhandled_key_input<class_Node_method_set_process_unhandled_key_input>`).
  1068. .. rst-class:: classref-item-separator
  1069. ----
  1070. .. _class_Node_method_move_child:
  1071. .. rst-class:: classref-method
  1072. void **move_child** **(** :ref:`Node<class_Node>` child_node, :ref:`int<class_int>` to_index **)**
  1073. Moves a child node to a different index (order) among the other children. Since calls, signals, etc. are performed by tree order, changing the order of children nodes may be useful. If ``to_index`` is negative, the index will be counted from the end.
  1074. \ **Note:** Internal children can only be moved within their expected "internal range" (see ``internal`` parameter in :ref:`add_child<class_Node_method_add_child>`).
  1075. .. rst-class:: classref-item-separator
  1076. ----
  1077. .. _class_Node_method_print_orphan_nodes:
  1078. .. rst-class:: classref-method
  1079. void **print_orphan_nodes** **(** **)** |static|
  1080. Prints all orphan nodes (nodes outside the :ref:`SceneTree<class_SceneTree>`). Used for debugging.
  1081. \ **Note:** :ref:`print_orphan_nodes<class_Node_method_print_orphan_nodes>` only works in debug builds. When called in a project exported in release mode, :ref:`print_orphan_nodes<class_Node_method_print_orphan_nodes>` will not print anything.
  1082. .. rst-class:: classref-item-separator
  1083. ----
  1084. .. _class_Node_method_print_tree:
  1085. .. rst-class:: classref-method
  1086. void **print_tree** **(** **)**
  1087. Prints the tree to stdout. Used mainly for debugging purposes. This version displays the path relative to the current node, and is good for copy/pasting into the :ref:`get_node<class_Node_method_get_node>` function.
  1088. \ **Example output:**\
  1089. ::
  1090. TheGame
  1091. TheGame/Menu
  1092. TheGame/Menu/Label
  1093. TheGame/Menu/Camera2D
  1094. TheGame/SplashScreen
  1095. TheGame/SplashScreen/Camera2D
  1096. .. rst-class:: classref-item-separator
  1097. ----
  1098. .. _class_Node_method_print_tree_pretty:
  1099. .. rst-class:: classref-method
  1100. void **print_tree_pretty** **(** **)**
  1101. Similar to :ref:`print_tree<class_Node_method_print_tree>`, this prints the tree to stdout. This version displays a more graphical representation similar to what is displayed in the Scene Dock. It is useful for inspecting larger trees.
  1102. \ **Example output:**\
  1103. ::
  1104. ┖╴TheGame
  1105. ┠╴Menu
  1106. ┃ ┠╴Label
  1107. ┃ ┖╴Camera2D
  1108. ┖╴SplashScreen
  1109. ┖╴Camera2D
  1110. .. rst-class:: classref-item-separator
  1111. ----
  1112. .. _class_Node_method_propagate_call:
  1113. .. rst-class:: classref-method
  1114. void **propagate_call** **(** :ref:`StringName<class_StringName>` method, :ref:`Array<class_Array>` args=[], :ref:`bool<class_bool>` parent_first=false **)**
  1115. Calls the given method (if present) with the arguments given in ``args`` on this node and recursively on all its children. If the ``parent_first`` argument is ``true``, the method will be called on the current node first, then on all its children. If ``parent_first`` is ``false``, the children will be called first.
  1116. .. rst-class:: classref-item-separator
  1117. ----
  1118. .. _class_Node_method_propagate_notification:
  1119. .. rst-class:: classref-method
  1120. void **propagate_notification** **(** :ref:`int<class_int>` what **)**
  1121. Notifies the current node and all its children recursively by calling :ref:`Object.notification<class_Object_method_notification>` on all of them.
  1122. .. rst-class:: classref-item-separator
  1123. ----
  1124. .. _class_Node_method_queue_free:
  1125. .. rst-class:: classref-method
  1126. void **queue_free** **(** **)**
  1127. Queues a node for deletion at the end of the current frame. When deleted, all of its child nodes will be deleted as well. This method ensures it's safe to delete the node, contrary to :ref:`Object.free<class_Object_method_free>`. Use :ref:`Object.is_queued_for_deletion<class_Object_method_is_queued_for_deletion>` to check whether a node will be deleted at the end of the frame.
  1128. .. rst-class:: classref-item-separator
  1129. ----
  1130. .. _class_Node_method_remove_child:
  1131. .. rst-class:: classref-method
  1132. void **remove_child** **(** :ref:`Node<class_Node>` node **)**
  1133. Removes a child node. The node is NOT deleted and must be deleted manually.
  1134. \ **Note:** This function may set the :ref:`owner<class_Node_property_owner>` of the removed Node (or its descendants) to be ``null``, if that :ref:`owner<class_Node_property_owner>` is no longer a parent or ancestor.
  1135. .. rst-class:: classref-item-separator
  1136. ----
  1137. .. _class_Node_method_remove_from_group:
  1138. .. rst-class:: classref-method
  1139. void **remove_from_group** **(** :ref:`StringName<class_StringName>` group **)**
  1140. Removes a node from the ``group``. Does nothing if the node is not in the ``group``. See notes in the description, and the group methods in :ref:`SceneTree<class_SceneTree>`.
  1141. .. rst-class:: classref-item-separator
  1142. ----
  1143. .. _class_Node_method_reparent:
  1144. .. rst-class:: classref-method
  1145. void **reparent** **(** :ref:`Node<class_Node>` new_parent, :ref:`bool<class_bool>` keep_global_transform=true **)**
  1146. Changes the parent of this **Node** to the ``new_parent``. The node needs to already have a parent.
  1147. If ``keep_global_transform`` is ``true``, the node's global transform will be preserved if supported. :ref:`Node2D<class_Node2D>`, :ref:`Node3D<class_Node3D>` and :ref:`Control<class_Control>` support this argument (but :ref:`Control<class_Control>` keeps only position).
  1148. .. rst-class:: classref-item-separator
  1149. ----
  1150. .. _class_Node_method_replace_by:
  1151. .. rst-class:: classref-method
  1152. void **replace_by** **(** :ref:`Node<class_Node>` node, :ref:`bool<class_bool>` keep_groups=false **)**
  1153. Replaces a node in a scene by the given one. Subscriptions that pass through this node will be lost.
  1154. If ``keep_groups`` is ``true``, the ``node`` is added to the same groups that the replaced node is in.
  1155. \ **Note:** The given node will become the new parent of any child nodes that the replaced node had.
  1156. \ **Note:** The replaced node is not automatically freed, so you either need to keep it in a variable for later use or free it using :ref:`Object.free<class_Object_method_free>`.
  1157. .. rst-class:: classref-item-separator
  1158. ----
  1159. .. _class_Node_method_request_ready:
  1160. .. rst-class:: classref-method
  1161. void **request_ready** **(** **)**
  1162. Requests that ``_ready`` be called again. Note that the method won't be called immediately, but is scheduled for when the node is added to the scene tree again (see :ref:`_ready<class_Node_method__ready>`). ``_ready`` is called only for the node which requested it, which means that you need to request ready for each child if you want them to call ``_ready`` too (in which case, ``_ready`` will be called in the same order as it would normally).
  1163. .. rst-class:: classref-item-separator
  1164. ----
  1165. .. _class_Node_method_rpc:
  1166. .. rst-class:: classref-method
  1167. :ref:`Error<enum_@GlobalScope_Error>` **rpc** **(** :ref:`StringName<class_StringName>` method, ... **)** |vararg|
  1168. Sends a remote procedure call request for the given ``method`` to peers on the network (and locally), optionally sending all additional arguments as arguments to the method called by the RPC. The call request will only be received by nodes with the same :ref:`NodePath<class_NodePath>`, including the exact same node name. Behavior depends on the RPC configuration for the given method, see :ref:`rpc_config<class_Node_method_rpc_config>` and :ref:`@GDScript.@rpc<class_@GDScript_annotation_@rpc>`. Methods are not exposed to RPCs by default. Returns ``null``.
  1169. \ **Note:** You can only safely use RPCs on clients after you received the ``connected_to_server`` signal from the :ref:`MultiplayerAPI<class_MultiplayerAPI>`. You also need to keep track of the connection state, either by the :ref:`MultiplayerAPI<class_MultiplayerAPI>` signals like ``server_disconnected`` or by checking ``get_multiplayer().peer.get_connection_status() == CONNECTION_CONNECTED``.
  1170. .. rst-class:: classref-item-separator
  1171. ----
  1172. .. _class_Node_method_rpc_config:
  1173. .. rst-class:: classref-method
  1174. void **rpc_config** **(** :ref:`StringName<class_StringName>` method, :ref:`Variant<class_Variant>` config **)**
  1175. Changes the RPC mode for the given ``method`` with the given ``config`` which should be ``null`` (to disable) or a :ref:`Dictionary<class_Dictionary>` in the form:
  1176. ::
  1177. {
  1178. rpc_mode = MultiplayerAPI.RPCMode,
  1179. transfer_mode = MultiplayerPeer.TranferMode,
  1180. call_local = false,
  1181. channel = 0,
  1182. }
  1183. See :ref:`RPCMode<enum_MultiplayerAPI_RPCMode>` and :ref:`TransferMode<enum_MultiplayerPeer_TransferMode>`. An alternative is annotating methods and properties with the corresponding :ref:`@GDScript.@rpc<class_@GDScript_annotation_@rpc>` annotation (``@rpc("any_peer")``, ``@rpc("authority")``). By default, methods are not exposed to networking (and RPCs).
  1184. .. rst-class:: classref-item-separator
  1185. ----
  1186. .. _class_Node_method_rpc_id:
  1187. .. rst-class:: classref-method
  1188. :ref:`Error<enum_@GlobalScope_Error>` **rpc_id** **(** :ref:`int<class_int>` peer_id, :ref:`StringName<class_StringName>` method, ... **)** |vararg|
  1189. Sends a :ref:`rpc<class_Node_method_rpc>` to a specific peer identified by ``peer_id`` (see :ref:`MultiplayerPeer.set_target_peer<class_MultiplayerPeer_method_set_target_peer>`). Returns ``null``.
  1190. .. rst-class:: classref-item-separator
  1191. ----
  1192. .. _class_Node_method_set_display_folded:
  1193. .. rst-class:: classref-method
  1194. void **set_display_folded** **(** :ref:`bool<class_bool>` fold **)**
  1195. Sets the folded state of the node in the Scene dock. This method is only intended for use with editor tooling.
  1196. .. rst-class:: classref-item-separator
  1197. ----
  1198. .. _class_Node_method_set_editable_instance:
  1199. .. rst-class:: classref-method
  1200. void **set_editable_instance** **(** :ref:`Node<class_Node>` node, :ref:`bool<class_bool>` is_editable **)**
  1201. Sets the editable children state of ``node`` relative to this node. This method is only intended for use with editor tooling.
  1202. .. rst-class:: classref-item-separator
  1203. ----
  1204. .. _class_Node_method_set_multiplayer_authority:
  1205. .. rst-class:: classref-method
  1206. void **set_multiplayer_authority** **(** :ref:`int<class_int>` id, :ref:`bool<class_bool>` recursive=true **)**
  1207. Sets the node's multiplayer authority to the peer with the given peer ID. The multiplayer authority is the peer that has authority over the node on the network. Useful in conjunction with :ref:`rpc_config<class_Node_method_rpc_config>` and the :ref:`MultiplayerAPI<class_MultiplayerAPI>`. Inherited from the parent node by default, which ultimately defaults to peer ID 1 (the server). If ``recursive``, the given peer is recursively set as the authority for all children of this node.
  1208. .. rst-class:: classref-item-separator
  1209. ----
  1210. .. _class_Node_method_set_physics_process:
  1211. .. rst-class:: classref-method
  1212. void **set_physics_process** **(** :ref:`bool<class_bool>` enable **)**
  1213. Enables or disables physics (i.e. fixed framerate) processing. When a node is being processed, it will receive a :ref:`NOTIFICATION_PHYSICS_PROCESS<class_Node_constant_NOTIFICATION_PHYSICS_PROCESS>` at a fixed (usually 60 FPS, see :ref:`Engine.physics_ticks_per_second<class_Engine_property_physics_ticks_per_second>` to change) interval (and the :ref:`_physics_process<class_Node_method__physics_process>` callback will be called if exists). Enabled automatically if :ref:`_physics_process<class_Node_method__physics_process>` is overridden. Any calls to this before :ref:`_ready<class_Node_method__ready>` will be ignored.
  1214. .. rst-class:: classref-item-separator
  1215. ----
  1216. .. _class_Node_method_set_physics_process_internal:
  1217. .. rst-class:: classref-method
  1218. void **set_physics_process_internal** **(** :ref:`bool<class_bool>` enable **)**
  1219. Enables or disables internal physics for this node. Internal physics processing happens in isolation from the normal :ref:`_physics_process<class_Node_method__physics_process>` calls and is used by some nodes internally to guarantee proper functioning even if the node is paused or physics processing is disabled for scripting (:ref:`set_physics_process<class_Node_method_set_physics_process>`). Only useful for advanced uses to manipulate built-in nodes' behavior.
  1220. \ **Warning:** Built-in Nodes rely on the internal processing for their own logic, so changing this value from your code may lead to unexpected behavior. Script access to this internal logic is provided for specific advanced uses, but is unsafe and not supported.
  1221. .. rst-class:: classref-item-separator
  1222. ----
  1223. .. _class_Node_method_set_process:
  1224. .. rst-class:: classref-method
  1225. void **set_process** **(** :ref:`bool<class_bool>` enable **)**
  1226. Enables or disables processing. When a node is being processed, it will receive a :ref:`NOTIFICATION_PROCESS<class_Node_constant_NOTIFICATION_PROCESS>` on every drawn frame (and the :ref:`_process<class_Node_method__process>` callback will be called if exists). Enabled automatically if :ref:`_process<class_Node_method__process>` is overridden. Any calls to this before :ref:`_ready<class_Node_method__ready>` will be ignored.
  1227. .. rst-class:: classref-item-separator
  1228. ----
  1229. .. _class_Node_method_set_process_input:
  1230. .. rst-class:: classref-method
  1231. void **set_process_input** **(** :ref:`bool<class_bool>` enable **)**
  1232. Enables or disables input processing. This is not required for GUI controls! Enabled automatically if :ref:`_input<class_Node_method__input>` is overridden. Any calls to this before :ref:`_ready<class_Node_method__ready>` will be ignored.
  1233. .. rst-class:: classref-item-separator
  1234. ----
  1235. .. _class_Node_method_set_process_internal:
  1236. .. rst-class:: classref-method
  1237. void **set_process_internal** **(** :ref:`bool<class_bool>` enable **)**
  1238. Enables or disabled internal processing for this node. Internal processing happens in isolation from the normal :ref:`_process<class_Node_method__process>` calls and is used by some nodes internally to guarantee proper functioning even if the node is paused or processing is disabled for scripting (:ref:`set_process<class_Node_method_set_process>`). Only useful for advanced uses to manipulate built-in nodes' behavior.
  1239. \ **Warning:** Built-in Nodes rely on the internal processing for their own logic, so changing this value from your code may lead to unexpected behavior. Script access to this internal logic is provided for specific advanced uses, but is unsafe and not supported.
  1240. .. rst-class:: classref-item-separator
  1241. ----
  1242. .. _class_Node_method_set_process_shortcut_input:
  1243. .. rst-class:: classref-method
  1244. void **set_process_shortcut_input** **(** :ref:`bool<class_bool>` enable **)**
  1245. Enables shortcut processing. Enabled automatically if :ref:`_shortcut_input<class_Node_method__shortcut_input>` is overridden. Any calls to this before :ref:`_ready<class_Node_method__ready>` will be ignored.
  1246. .. rst-class:: classref-item-separator
  1247. ----
  1248. .. _class_Node_method_set_process_unhandled_input:
  1249. .. rst-class:: classref-method
  1250. void **set_process_unhandled_input** **(** :ref:`bool<class_bool>` enable **)**
  1251. Enables unhandled input processing. This is not required for GUI controls! It enables the node to receive all input that was not previously handled (usually by a :ref:`Control<class_Control>`). Enabled automatically if :ref:`_unhandled_input<class_Node_method__unhandled_input>` is overridden. Any calls to this before :ref:`_ready<class_Node_method__ready>` will be ignored.
  1252. .. rst-class:: classref-item-separator
  1253. ----
  1254. .. _class_Node_method_set_process_unhandled_key_input:
  1255. .. rst-class:: classref-method
  1256. void **set_process_unhandled_key_input** **(** :ref:`bool<class_bool>` enable **)**
  1257. Enables unhandled key input processing. Enabled automatically if :ref:`_unhandled_key_input<class_Node_method__unhandled_key_input>` is overridden. Any calls to this before :ref:`_ready<class_Node_method__ready>` will be ignored.
  1258. .. rst-class:: classref-item-separator
  1259. ----
  1260. .. _class_Node_method_set_scene_instance_load_placeholder:
  1261. .. rst-class:: classref-method
  1262. void **set_scene_instance_load_placeholder** **(** :ref:`bool<class_bool>` load_placeholder **)**
  1263. Sets whether this is an instance load placeholder. See :ref:`InstancePlaceholder<class_InstancePlaceholder>`.
  1264. .. rst-class:: classref-item-separator
  1265. ----
  1266. .. _class_Node_method_update_configuration_warnings:
  1267. .. rst-class:: classref-method
  1268. void **update_configuration_warnings** **(** **)**
  1269. Updates the warning displayed for this node in the Scene Dock.
  1270. Use :ref:`_get_configuration_warnings<class_Node_method__get_configuration_warnings>` to setup the warning message to display.
  1271. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  1272. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  1273. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  1274. .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
  1275. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
  1276. .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`