class_graphnode.rst 48 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935
  1. :github_url: hide
  2. .. DO NOT EDIT THIS FILE!!!
  3. .. Generated automatically from Godot engine sources.
  4. .. Generator: https://github.com/godotengine/godot/tree/3.5/doc/tools/make_rst.py.
  5. .. XML source: https://github.com/godotengine/godot/tree/3.5/doc/classes/GraphNode.xml.
  6. .. _class_GraphNode:
  7. GraphNode
  8. =========
  9. **Inherits:** :ref:`Container<class_Container>` **<** :ref:`Control<class_Control>` **<** :ref:`CanvasItem<class_CanvasItem>` **<** :ref:`Node<class_Node>` **<** :ref:`Object<class_Object>`
  10. A GraphNode is a container with potentially several input and output slots allowing connections between GraphNodes. Slots can have different, incompatible types.
  11. .. rst-class:: classref-introduction-group
  12. Description
  13. -----------
  14. A GraphNode is a container. Each GraphNode can have several input and output slots, sometimes referred to as ports, allowing connections between GraphNodes. To add a slot to GraphNode, add any :ref:`Control<class_Control>`-derived child node to it.
  15. After adding at least one child to GraphNode new sections will be automatically created in the Inspector called 'Slot'. When 'Slot' is expanded you will see list with index number for each slot. You can click on each of them to expand further.
  16. In the Inspector you can enable (show) or disable (hide) slots. By default, all slots are disabled so you may not see any slots on your GraphNode initially. You can assign a type to each slot. Only slots of the same type will be able to connect to each other. You can also assign colors to slots. A tuple of input and output slots is defined for each GUI element included in the GraphNode. Input connections are on the left and output connections are on the right side of GraphNode. Only enabled slots are counted as connections.
  17. .. rst-class:: classref-reftable-group
  18. Properties
  19. ----------
  20. .. table::
  21. :widths: auto
  22. +----------------------------------------+--------------------------------------------------------+---------------------+
  23. | :ref:`bool<class_bool>` | :ref:`comment<class_GraphNode_property_comment>` | ``false`` |
  24. +----------------------------------------+--------------------------------------------------------+---------------------+
  25. | :ref:`Vector2<class_Vector2>` | :ref:`offset<class_GraphNode_property_offset>` | ``Vector2( 0, 0 )`` |
  26. +----------------------------------------+--------------------------------------------------------+---------------------+
  27. | :ref:`Overlay<enum_GraphNode_Overlay>` | :ref:`overlay<class_GraphNode_property_overlay>` | ``0`` |
  28. +----------------------------------------+--------------------------------------------------------+---------------------+
  29. | :ref:`bool<class_bool>` | :ref:`resizable<class_GraphNode_property_resizable>` | ``false`` |
  30. +----------------------------------------+--------------------------------------------------------+---------------------+
  31. | :ref:`bool<class_bool>` | :ref:`selected<class_GraphNode_property_selected>` | ``false`` |
  32. +----------------------------------------+--------------------------------------------------------+---------------------+
  33. | :ref:`bool<class_bool>` | :ref:`show_close<class_GraphNode_property_show_close>` | ``false`` |
  34. +----------------------------------------+--------------------------------------------------------+---------------------+
  35. | :ref:`String<class_String>` | :ref:`title<class_GraphNode_property_title>` | ``""`` |
  36. +----------------------------------------+--------------------------------------------------------+---------------------+
  37. .. rst-class:: classref-reftable-group
  38. Methods
  39. -------
  40. .. table::
  41. :widths: auto
  42. +-------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  43. | void | :ref:`clear_all_slots<class_GraphNode_method_clear_all_slots>` **(** **)** |
  44. +-------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  45. | void | :ref:`clear_slot<class_GraphNode_method_clear_slot>` **(** :ref:`int<class_int>` idx **)** |
  46. +-------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  47. | :ref:`Color<class_Color>` | :ref:`get_connection_input_color<class_GraphNode_method_get_connection_input_color>` **(** :ref:`int<class_int>` idx **)** |
  48. +-------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  49. | :ref:`int<class_int>` | :ref:`get_connection_input_count<class_GraphNode_method_get_connection_input_count>` **(** **)** |
  50. +-------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  51. | :ref:`Vector2<class_Vector2>` | :ref:`get_connection_input_position<class_GraphNode_method_get_connection_input_position>` **(** :ref:`int<class_int>` idx **)** |
  52. +-------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  53. | :ref:`int<class_int>` | :ref:`get_connection_input_type<class_GraphNode_method_get_connection_input_type>` **(** :ref:`int<class_int>` idx **)** |
  54. +-------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  55. | :ref:`Color<class_Color>` | :ref:`get_connection_output_color<class_GraphNode_method_get_connection_output_color>` **(** :ref:`int<class_int>` idx **)** |
  56. +-------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  57. | :ref:`int<class_int>` | :ref:`get_connection_output_count<class_GraphNode_method_get_connection_output_count>` **(** **)** |
  58. +-------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  59. | :ref:`Vector2<class_Vector2>` | :ref:`get_connection_output_position<class_GraphNode_method_get_connection_output_position>` **(** :ref:`int<class_int>` idx **)** |
  60. +-------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  61. | :ref:`int<class_int>` | :ref:`get_connection_output_type<class_GraphNode_method_get_connection_output_type>` **(** :ref:`int<class_int>` idx **)** |
  62. +-------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  63. | :ref:`Color<class_Color>` | :ref:`get_slot_color_left<class_GraphNode_method_get_slot_color_left>` **(** :ref:`int<class_int>` idx **)** |const| |
  64. +-------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  65. | :ref:`Color<class_Color>` | :ref:`get_slot_color_right<class_GraphNode_method_get_slot_color_right>` **(** :ref:`int<class_int>` idx **)** |const| |
  66. +-------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  67. | :ref:`int<class_int>` | :ref:`get_slot_type_left<class_GraphNode_method_get_slot_type_left>` **(** :ref:`int<class_int>` idx **)** |const| |
  68. +-------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  69. | :ref:`int<class_int>` | :ref:`get_slot_type_right<class_GraphNode_method_get_slot_type_right>` **(** :ref:`int<class_int>` idx **)** |const| |
  70. +-------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  71. | :ref:`bool<class_bool>` | :ref:`is_slot_enabled_left<class_GraphNode_method_is_slot_enabled_left>` **(** :ref:`int<class_int>` idx **)** |const| |
  72. +-------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  73. | :ref:`bool<class_bool>` | :ref:`is_slot_enabled_right<class_GraphNode_method_is_slot_enabled_right>` **(** :ref:`int<class_int>` idx **)** |const| |
  74. +-------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  75. | void | :ref:`set_slot<class_GraphNode_method_set_slot>` **(** :ref:`int<class_int>` idx, :ref:`bool<class_bool>` enable_left, :ref:`int<class_int>` type_left, :ref:`Color<class_Color>` color_left, :ref:`bool<class_bool>` enable_right, :ref:`int<class_int>` type_right, :ref:`Color<class_Color>` color_right, :ref:`Texture<class_Texture>` custom_left=null, :ref:`Texture<class_Texture>` custom_right=null **)** |
  76. +-------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  77. | void | :ref:`set_slot_color_left<class_GraphNode_method_set_slot_color_left>` **(** :ref:`int<class_int>` idx, :ref:`Color<class_Color>` color_left **)** |
  78. +-------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  79. | void | :ref:`set_slot_color_right<class_GraphNode_method_set_slot_color_right>` **(** :ref:`int<class_int>` idx, :ref:`Color<class_Color>` color_right **)** |
  80. +-------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  81. | void | :ref:`set_slot_enabled_left<class_GraphNode_method_set_slot_enabled_left>` **(** :ref:`int<class_int>` idx, :ref:`bool<class_bool>` enable_left **)** |
  82. +-------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  83. | void | :ref:`set_slot_enabled_right<class_GraphNode_method_set_slot_enabled_right>` **(** :ref:`int<class_int>` idx, :ref:`bool<class_bool>` enable_right **)** |
  84. +-------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  85. | void | :ref:`set_slot_type_left<class_GraphNode_method_set_slot_type_left>` **(** :ref:`int<class_int>` idx, :ref:`int<class_int>` type_left **)** |
  86. +-------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  87. | void | :ref:`set_slot_type_right<class_GraphNode_method_set_slot_type_right>` **(** :ref:`int<class_int>` idx, :ref:`int<class_int>` type_right **)** |
  88. +-------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  89. .. rst-class:: classref-reftable-group
  90. Theme Properties
  91. ----------------
  92. .. table::
  93. :widths: auto
  94. +---------------------------------+------------------------------------------------------------------+-------------------------+
  95. | :ref:`Color<class_Color>` | :ref:`close_color<class_GraphNode_theme_color_close_color>` | ``Color( 0, 0, 0, 1 )`` |
  96. +---------------------------------+------------------------------------------------------------------+-------------------------+
  97. | :ref:`Color<class_Color>` | :ref:`resizer_color<class_GraphNode_theme_color_resizer_color>` | ``Color( 0, 0, 0, 1 )`` |
  98. +---------------------------------+------------------------------------------------------------------+-------------------------+
  99. | :ref:`Color<class_Color>` | :ref:`title_color<class_GraphNode_theme_color_title_color>` | ``Color( 0, 0, 0, 1 )`` |
  100. +---------------------------------+------------------------------------------------------------------+-------------------------+
  101. | :ref:`int<class_int>` | :ref:`close_offset<class_GraphNode_theme_constant_close_offset>` | ``18`` |
  102. +---------------------------------+------------------------------------------------------------------+-------------------------+
  103. | :ref:`int<class_int>` | :ref:`port_offset<class_GraphNode_theme_constant_port_offset>` | ``3`` |
  104. +---------------------------------+------------------------------------------------------------------+-------------------------+
  105. | :ref:`int<class_int>` | :ref:`separation<class_GraphNode_theme_constant_separation>` | ``1`` |
  106. +---------------------------------+------------------------------------------------------------------+-------------------------+
  107. | :ref:`int<class_int>` | :ref:`title_offset<class_GraphNode_theme_constant_title_offset>` | ``20`` |
  108. +---------------------------------+------------------------------------------------------------------+-------------------------+
  109. | :ref:`Font<class_Font>` | :ref:`title_font<class_GraphNode_theme_font_title_font>` | |
  110. +---------------------------------+------------------------------------------------------------------+-------------------------+
  111. | :ref:`Texture<class_Texture>` | :ref:`close<class_GraphNode_theme_icon_close>` | |
  112. +---------------------------------+------------------------------------------------------------------+-------------------------+
  113. | :ref:`Texture<class_Texture>` | :ref:`port<class_GraphNode_theme_icon_port>` | |
  114. +---------------------------------+------------------------------------------------------------------+-------------------------+
  115. | :ref:`Texture<class_Texture>` | :ref:`resizer<class_GraphNode_theme_icon_resizer>` | |
  116. +---------------------------------+------------------------------------------------------------------+-------------------------+
  117. | :ref:`StyleBox<class_StyleBox>` | :ref:`breakpoint<class_GraphNode_theme_style_breakpoint>` | |
  118. +---------------------------------+------------------------------------------------------------------+-------------------------+
  119. | :ref:`StyleBox<class_StyleBox>` | :ref:`comment<class_GraphNode_theme_style_comment>` | |
  120. +---------------------------------+------------------------------------------------------------------+-------------------------+
  121. | :ref:`StyleBox<class_StyleBox>` | :ref:`commentfocus<class_GraphNode_theme_style_commentfocus>` | |
  122. +---------------------------------+------------------------------------------------------------------+-------------------------+
  123. | :ref:`StyleBox<class_StyleBox>` | :ref:`defaultfocus<class_GraphNode_theme_style_defaultfocus>` | |
  124. +---------------------------------+------------------------------------------------------------------+-------------------------+
  125. | :ref:`StyleBox<class_StyleBox>` | :ref:`defaultframe<class_GraphNode_theme_style_defaultframe>` | |
  126. +---------------------------------+------------------------------------------------------------------+-------------------------+
  127. | :ref:`StyleBox<class_StyleBox>` | :ref:`frame<class_GraphNode_theme_style_frame>` | |
  128. +---------------------------------+------------------------------------------------------------------+-------------------------+
  129. | :ref:`StyleBox<class_StyleBox>` | :ref:`position<class_GraphNode_theme_style_position>` | |
  130. +---------------------------------+------------------------------------------------------------------+-------------------------+
  131. | :ref:`StyleBox<class_StyleBox>` | :ref:`selectedframe<class_GraphNode_theme_style_selectedframe>` | |
  132. +---------------------------------+------------------------------------------------------------------+-------------------------+
  133. .. rst-class:: classref-section-separator
  134. ----
  135. .. rst-class:: classref-descriptions-group
  136. Signals
  137. -------
  138. .. _class_GraphNode_signal_close_request:
  139. .. rst-class:: classref-signal
  140. **close_request** **(** **)**
  141. Emitted when the GraphNode is requested to be closed. Happens on clicking the close button (see :ref:`show_close<class_GraphNode_property_show_close>`).
  142. .. rst-class:: classref-item-separator
  143. ----
  144. .. _class_GraphNode_signal_dragged:
  145. .. rst-class:: classref-signal
  146. **dragged** **(** :ref:`Vector2<class_Vector2>` from, :ref:`Vector2<class_Vector2>` to **)**
  147. Emitted when the GraphNode is dragged.
  148. .. rst-class:: classref-item-separator
  149. ----
  150. .. _class_GraphNode_signal_offset_changed:
  151. .. rst-class:: classref-signal
  152. **offset_changed** **(** **)**
  153. Emitted when the GraphNode is moved.
  154. .. rst-class:: classref-item-separator
  155. ----
  156. .. _class_GraphNode_signal_raise_request:
  157. .. rst-class:: classref-signal
  158. **raise_request** **(** **)**
  159. Emitted when the GraphNode is requested to be displayed over other ones. Happens on focusing (clicking into) the GraphNode.
  160. .. rst-class:: classref-item-separator
  161. ----
  162. .. _class_GraphNode_signal_resize_request:
  163. .. rst-class:: classref-signal
  164. **resize_request** **(** :ref:`Vector2<class_Vector2>` new_minsize **)**
  165. Emitted when the GraphNode is requested to be resized. Happens on dragging the resizer handle (see :ref:`resizable<class_GraphNode_property_resizable>`).
  166. .. rst-class:: classref-item-separator
  167. ----
  168. .. _class_GraphNode_signal_slot_updated:
  169. .. rst-class:: classref-signal
  170. **slot_updated** **(** :ref:`int<class_int>` idx **)**
  171. Emitted when any GraphNode's slot is updated.
  172. .. rst-class:: classref-section-separator
  173. ----
  174. .. rst-class:: classref-descriptions-group
  175. Enumerations
  176. ------------
  177. .. _enum_GraphNode_Overlay:
  178. .. rst-class:: classref-enumeration
  179. enum **Overlay**:
  180. .. _class_GraphNode_constant_OVERLAY_DISABLED:
  181. .. rst-class:: classref-enumeration-constant
  182. :ref:`Overlay<enum_GraphNode_Overlay>` **OVERLAY_DISABLED** = ``0``
  183. No overlay is shown.
  184. .. _class_GraphNode_constant_OVERLAY_BREAKPOINT:
  185. .. rst-class:: classref-enumeration-constant
  186. :ref:`Overlay<enum_GraphNode_Overlay>` **OVERLAY_BREAKPOINT** = ``1``
  187. Show overlay set in the ``breakpoint`` theme property.
  188. .. _class_GraphNode_constant_OVERLAY_POSITION:
  189. .. rst-class:: classref-enumeration-constant
  190. :ref:`Overlay<enum_GraphNode_Overlay>` **OVERLAY_POSITION** = ``2``
  191. Show overlay set in the ``position`` theme property.
  192. .. rst-class:: classref-section-separator
  193. ----
  194. .. rst-class:: classref-descriptions-group
  195. Property Descriptions
  196. ---------------------
  197. .. _class_GraphNode_property_comment:
  198. .. rst-class:: classref-property
  199. :ref:`bool<class_bool>` **comment** = ``false``
  200. .. rst-class:: classref-property-setget
  201. - void **set_comment** **(** :ref:`bool<class_bool>` value **)**
  202. - :ref:`bool<class_bool>` **is_comment** **(** **)**
  203. If ``true``, the GraphNode is a comment node.
  204. .. rst-class:: classref-item-separator
  205. ----
  206. .. _class_GraphNode_property_offset:
  207. .. rst-class:: classref-property
  208. :ref:`Vector2<class_Vector2>` **offset** = ``Vector2( 0, 0 )``
  209. .. rst-class:: classref-property-setget
  210. - void **set_offset** **(** :ref:`Vector2<class_Vector2>` value **)**
  211. - :ref:`Vector2<class_Vector2>` **get_offset** **(** **)**
  212. The offset of the GraphNode, relative to the scroll offset of the :ref:`GraphEdit<class_GraphEdit>`.
  213. \ **Note:** You cannot use position directly, as :ref:`GraphEdit<class_GraphEdit>` is a :ref:`Container<class_Container>`.
  214. .. rst-class:: classref-item-separator
  215. ----
  216. .. _class_GraphNode_property_overlay:
  217. .. rst-class:: classref-property
  218. :ref:`Overlay<enum_GraphNode_Overlay>` **overlay** = ``0``
  219. .. rst-class:: classref-property-setget
  220. - void **set_overlay** **(** :ref:`Overlay<enum_GraphNode_Overlay>` value **)**
  221. - :ref:`Overlay<enum_GraphNode_Overlay>` **get_overlay** **(** **)**
  222. Sets the overlay shown above the GraphNode. See :ref:`Overlay<enum_GraphNode_Overlay>`.
  223. .. rst-class:: classref-item-separator
  224. ----
  225. .. _class_GraphNode_property_resizable:
  226. .. rst-class:: classref-property
  227. :ref:`bool<class_bool>` **resizable** = ``false``
  228. .. rst-class:: classref-property-setget
  229. - void **set_resizable** **(** :ref:`bool<class_bool>` value **)**
  230. - :ref:`bool<class_bool>` **is_resizable** **(** **)**
  231. If ``true``, the user can resize the GraphNode.
  232. \ **Note:** Dragging the handle will only emit the :ref:`resize_request<class_GraphNode_signal_resize_request>` signal, the GraphNode needs to be resized manually.
  233. .. rst-class:: classref-item-separator
  234. ----
  235. .. _class_GraphNode_property_selected:
  236. .. rst-class:: classref-property
  237. :ref:`bool<class_bool>` **selected** = ``false``
  238. .. rst-class:: classref-property-setget
  239. - void **set_selected** **(** :ref:`bool<class_bool>` value **)**
  240. - :ref:`bool<class_bool>` **is_selected** **(** **)**
  241. If ``true``, the GraphNode is selected.
  242. .. rst-class:: classref-item-separator
  243. ----
  244. .. _class_GraphNode_property_show_close:
  245. .. rst-class:: classref-property
  246. :ref:`bool<class_bool>` **show_close** = ``false``
  247. .. rst-class:: classref-property-setget
  248. - void **set_show_close_button** **(** :ref:`bool<class_bool>` value **)**
  249. - :ref:`bool<class_bool>` **is_close_button_visible** **(** **)**
  250. If ``true``, the close button will be visible.
  251. \ **Note:** Pressing it will only emit the :ref:`close_request<class_GraphNode_signal_close_request>` signal, the GraphNode needs to be removed manually.
  252. .. rst-class:: classref-item-separator
  253. ----
  254. .. _class_GraphNode_property_title:
  255. .. rst-class:: classref-property
  256. :ref:`String<class_String>` **title** = ``""``
  257. .. rst-class:: classref-property-setget
  258. - void **set_title** **(** :ref:`String<class_String>` value **)**
  259. - :ref:`String<class_String>` **get_title** **(** **)**
  260. The text displayed in the GraphNode's title bar.
  261. .. rst-class:: classref-section-separator
  262. ----
  263. .. rst-class:: classref-descriptions-group
  264. Method Descriptions
  265. -------------------
  266. .. _class_GraphNode_method_clear_all_slots:
  267. .. rst-class:: classref-method
  268. void **clear_all_slots** **(** **)**
  269. Disables all input and output slots of the GraphNode.
  270. .. rst-class:: classref-item-separator
  271. ----
  272. .. _class_GraphNode_method_clear_slot:
  273. .. rst-class:: classref-method
  274. void **clear_slot** **(** :ref:`int<class_int>` idx **)**
  275. Disables input and output slot whose index is ``idx``.
  276. .. rst-class:: classref-item-separator
  277. ----
  278. .. _class_GraphNode_method_get_connection_input_color:
  279. .. rst-class:: classref-method
  280. :ref:`Color<class_Color>` **get_connection_input_color** **(** :ref:`int<class_int>` idx **)**
  281. Returns the :ref:`Color<class_Color>` of the input connection ``idx``.
  282. .. rst-class:: classref-item-separator
  283. ----
  284. .. _class_GraphNode_method_get_connection_input_count:
  285. .. rst-class:: classref-method
  286. :ref:`int<class_int>` **get_connection_input_count** **(** **)**
  287. Returns the number of enabled input slots (connections) to the GraphNode.
  288. .. rst-class:: classref-item-separator
  289. ----
  290. .. _class_GraphNode_method_get_connection_input_position:
  291. .. rst-class:: classref-method
  292. :ref:`Vector2<class_Vector2>` **get_connection_input_position** **(** :ref:`int<class_int>` idx **)**
  293. Returns the position of the input connection ``idx``.
  294. .. rst-class:: classref-item-separator
  295. ----
  296. .. _class_GraphNode_method_get_connection_input_type:
  297. .. rst-class:: classref-method
  298. :ref:`int<class_int>` **get_connection_input_type** **(** :ref:`int<class_int>` idx **)**
  299. Returns the type of the input connection ``idx``.
  300. .. rst-class:: classref-item-separator
  301. ----
  302. .. _class_GraphNode_method_get_connection_output_color:
  303. .. rst-class:: classref-method
  304. :ref:`Color<class_Color>` **get_connection_output_color** **(** :ref:`int<class_int>` idx **)**
  305. Returns the :ref:`Color<class_Color>` of the output connection ``idx``.
  306. .. rst-class:: classref-item-separator
  307. ----
  308. .. _class_GraphNode_method_get_connection_output_count:
  309. .. rst-class:: classref-method
  310. :ref:`int<class_int>` **get_connection_output_count** **(** **)**
  311. Returns the number of enabled output slots (connections) of the GraphNode.
  312. .. rst-class:: classref-item-separator
  313. ----
  314. .. _class_GraphNode_method_get_connection_output_position:
  315. .. rst-class:: classref-method
  316. :ref:`Vector2<class_Vector2>` **get_connection_output_position** **(** :ref:`int<class_int>` idx **)**
  317. Returns the position of the output connection ``idx``.
  318. .. rst-class:: classref-item-separator
  319. ----
  320. .. _class_GraphNode_method_get_connection_output_type:
  321. .. rst-class:: classref-method
  322. :ref:`int<class_int>` **get_connection_output_type** **(** :ref:`int<class_int>` idx **)**
  323. Returns the type of the output connection ``idx``.
  324. .. rst-class:: classref-item-separator
  325. ----
  326. .. _class_GraphNode_method_get_slot_color_left:
  327. .. rst-class:: classref-method
  328. :ref:`Color<class_Color>` **get_slot_color_left** **(** :ref:`int<class_int>` idx **)** |const|
  329. Returns the left (input) :ref:`Color<class_Color>` of the slot ``idx``.
  330. .. rst-class:: classref-item-separator
  331. ----
  332. .. _class_GraphNode_method_get_slot_color_right:
  333. .. rst-class:: classref-method
  334. :ref:`Color<class_Color>` **get_slot_color_right** **(** :ref:`int<class_int>` idx **)** |const|
  335. Returns the right (output) :ref:`Color<class_Color>` of the slot ``idx``.
  336. .. rst-class:: classref-item-separator
  337. ----
  338. .. _class_GraphNode_method_get_slot_type_left:
  339. .. rst-class:: classref-method
  340. :ref:`int<class_int>` **get_slot_type_left** **(** :ref:`int<class_int>` idx **)** |const|
  341. Returns the left (input) type of the slot ``idx``.
  342. .. rst-class:: classref-item-separator
  343. ----
  344. .. _class_GraphNode_method_get_slot_type_right:
  345. .. rst-class:: classref-method
  346. :ref:`int<class_int>` **get_slot_type_right** **(** :ref:`int<class_int>` idx **)** |const|
  347. Returns the right (output) type of the slot ``idx``.
  348. .. rst-class:: classref-item-separator
  349. ----
  350. .. _class_GraphNode_method_is_slot_enabled_left:
  351. .. rst-class:: classref-method
  352. :ref:`bool<class_bool>` **is_slot_enabled_left** **(** :ref:`int<class_int>` idx **)** |const|
  353. Returns ``true`` if left (input) side of the slot ``idx`` is enabled.
  354. .. rst-class:: classref-item-separator
  355. ----
  356. .. _class_GraphNode_method_is_slot_enabled_right:
  357. .. rst-class:: classref-method
  358. :ref:`bool<class_bool>` **is_slot_enabled_right** **(** :ref:`int<class_int>` idx **)** |const|
  359. Returns ``true`` if right (output) side of the slot ``idx`` is enabled.
  360. .. rst-class:: classref-item-separator
  361. ----
  362. .. _class_GraphNode_method_set_slot:
  363. .. rst-class:: classref-method
  364. void **set_slot** **(** :ref:`int<class_int>` idx, :ref:`bool<class_bool>` enable_left, :ref:`int<class_int>` type_left, :ref:`Color<class_Color>` color_left, :ref:`bool<class_bool>` enable_right, :ref:`int<class_int>` type_right, :ref:`Color<class_Color>` color_right, :ref:`Texture<class_Texture>` custom_left=null, :ref:`Texture<class_Texture>` custom_right=null **)**
  365. Sets properties of the slot with ID ``idx``.
  366. If ``enable_left``/``right``, a port will appear and the slot will be able to be connected from this side.
  367. \ ``type_left``/``right`` is an arbitrary type of the port. Only ports with the same type values can be connected.
  368. \ ``color_left``/``right`` is the tint of the port's icon on this side.
  369. \ ``custom_left``/``right`` is a custom texture for this side's port.
  370. \ **Note:** This method only sets properties of the slot. To create the slot, add a :ref:`Control<class_Control>`-derived child to the GraphNode.
  371. Individual properties can be set using one of the ``set_slot_*`` methods. You must enable at least one side of the slot to do so.
  372. .. rst-class:: classref-item-separator
  373. ----
  374. .. _class_GraphNode_method_set_slot_color_left:
  375. .. rst-class:: classref-method
  376. void **set_slot_color_left** **(** :ref:`int<class_int>` idx, :ref:`Color<class_Color>` color_left **)**
  377. Sets the :ref:`Color<class_Color>` of the left (input) side of the slot ``idx`` to ``color_left``.
  378. .. rst-class:: classref-item-separator
  379. ----
  380. .. _class_GraphNode_method_set_slot_color_right:
  381. .. rst-class:: classref-method
  382. void **set_slot_color_right** **(** :ref:`int<class_int>` idx, :ref:`Color<class_Color>` color_right **)**
  383. Sets the :ref:`Color<class_Color>` of the right (output) side of the slot ``idx`` to ``color_right``.
  384. .. rst-class:: classref-item-separator
  385. ----
  386. .. _class_GraphNode_method_set_slot_enabled_left:
  387. .. rst-class:: classref-method
  388. void **set_slot_enabled_left** **(** :ref:`int<class_int>` idx, :ref:`bool<class_bool>` enable_left **)**
  389. Toggles the left (input) side of the slot ``idx``. If ``enable_left`` is ``true``, a port will appear on the left side and the slot will be able to be connected from this side.
  390. .. rst-class:: classref-item-separator
  391. ----
  392. .. _class_GraphNode_method_set_slot_enabled_right:
  393. .. rst-class:: classref-method
  394. void **set_slot_enabled_right** **(** :ref:`int<class_int>` idx, :ref:`bool<class_bool>` enable_right **)**
  395. Toggles the right (output) side of the slot ``idx``. If ``enable_right`` is ``true``, a port will appear on the right side and the slot will be able to be connected from this side.
  396. .. rst-class:: classref-item-separator
  397. ----
  398. .. _class_GraphNode_method_set_slot_type_left:
  399. .. rst-class:: classref-method
  400. void **set_slot_type_left** **(** :ref:`int<class_int>` idx, :ref:`int<class_int>` type_left **)**
  401. Sets the left (input) type of the slot ``idx`` to ``type_left``.
  402. .. rst-class:: classref-item-separator
  403. ----
  404. .. _class_GraphNode_method_set_slot_type_right:
  405. .. rst-class:: classref-method
  406. void **set_slot_type_right** **(** :ref:`int<class_int>` idx, :ref:`int<class_int>` type_right **)**
  407. Sets the right (output) type of the slot ``idx`` to ``type_right``.
  408. .. rst-class:: classref-section-separator
  409. ----
  410. .. rst-class:: classref-descriptions-group
  411. Theme Property Descriptions
  412. ---------------------------
  413. .. _class_GraphNode_theme_color_close_color:
  414. .. rst-class:: classref-themeproperty
  415. :ref:`Color<class_Color>` **close_color** = ``Color( 0, 0, 0, 1 )``
  416. The color modulation applied to the close button icon.
  417. .. rst-class:: classref-item-separator
  418. ----
  419. .. _class_GraphNode_theme_color_resizer_color:
  420. .. rst-class:: classref-themeproperty
  421. :ref:`Color<class_Color>` **resizer_color** = ``Color( 0, 0, 0, 1 )``
  422. The color modulation applied to the resizer icon.
  423. .. rst-class:: classref-item-separator
  424. ----
  425. .. _class_GraphNode_theme_color_title_color:
  426. .. rst-class:: classref-themeproperty
  427. :ref:`Color<class_Color>` **title_color** = ``Color( 0, 0, 0, 1 )``
  428. Color of the title text.
  429. .. rst-class:: classref-item-separator
  430. ----
  431. .. _class_GraphNode_theme_constant_close_offset:
  432. .. rst-class:: classref-themeproperty
  433. :ref:`int<class_int>` **close_offset** = ``18``
  434. The vertical offset of the close button.
  435. .. rst-class:: classref-item-separator
  436. ----
  437. .. _class_GraphNode_theme_constant_port_offset:
  438. .. rst-class:: classref-themeproperty
  439. :ref:`int<class_int>` **port_offset** = ``3``
  440. Horizontal offset for the ports.
  441. .. rst-class:: classref-item-separator
  442. ----
  443. .. _class_GraphNode_theme_constant_separation:
  444. .. rst-class:: classref-themeproperty
  445. :ref:`int<class_int>` **separation** = ``1``
  446. The vertical distance between ports.
  447. .. rst-class:: classref-item-separator
  448. ----
  449. .. _class_GraphNode_theme_constant_title_offset:
  450. .. rst-class:: classref-themeproperty
  451. :ref:`int<class_int>` **title_offset** = ``20``
  452. Vertical offset of the title text.
  453. .. rst-class:: classref-item-separator
  454. ----
  455. .. _class_GraphNode_theme_font_title_font:
  456. .. rst-class:: classref-themeproperty
  457. :ref:`Font<class_Font>` **title_font**
  458. Font used for the title text.
  459. .. rst-class:: classref-item-separator
  460. ----
  461. .. _class_GraphNode_theme_icon_close:
  462. .. rst-class:: classref-themeproperty
  463. :ref:`Texture<class_Texture>` **close**
  464. The icon for the close button, visible when :ref:`show_close<class_GraphNode_property_show_close>` is enabled.
  465. .. rst-class:: classref-item-separator
  466. ----
  467. .. _class_GraphNode_theme_icon_port:
  468. .. rst-class:: classref-themeproperty
  469. :ref:`Texture<class_Texture>` **port**
  470. The icon used for representing ports.
  471. .. rst-class:: classref-item-separator
  472. ----
  473. .. _class_GraphNode_theme_icon_resizer:
  474. .. rst-class:: classref-themeproperty
  475. :ref:`Texture<class_Texture>` **resizer**
  476. The icon used for resizer, visible when :ref:`resizable<class_GraphNode_property_resizable>` is enabled.
  477. .. rst-class:: classref-item-separator
  478. ----
  479. .. _class_GraphNode_theme_style_breakpoint:
  480. .. rst-class:: classref-themeproperty
  481. :ref:`StyleBox<class_StyleBox>` **breakpoint**
  482. The background used when :ref:`overlay<class_GraphNode_property_overlay>` is set to :ref:`OVERLAY_BREAKPOINT<class_GraphNode_constant_OVERLAY_BREAKPOINT>`.
  483. .. rst-class:: classref-item-separator
  484. ----
  485. .. _class_GraphNode_theme_style_comment:
  486. .. rst-class:: classref-themeproperty
  487. :ref:`StyleBox<class_StyleBox>` **comment**
  488. The :ref:`StyleBox<class_StyleBox>` used when :ref:`comment<class_GraphNode_property_comment>` is enabled.
  489. .. rst-class:: classref-item-separator
  490. ----
  491. .. _class_GraphNode_theme_style_commentfocus:
  492. .. rst-class:: classref-themeproperty
  493. :ref:`StyleBox<class_StyleBox>` **commentfocus**
  494. The :ref:`StyleBox<class_StyleBox>` used when :ref:`comment<class_GraphNode_property_comment>` is enabled and the **GraphNode** is focused.
  495. .. rst-class:: classref-item-separator
  496. ----
  497. .. _class_GraphNode_theme_style_defaultfocus:
  498. .. rst-class:: classref-themeproperty
  499. :ref:`StyleBox<class_StyleBox>` **defaultfocus**
  500. .. container:: contribute
  501. There is currently no description for this theme property. Please help us by :ref:`contributing one <doc_updating_the_class_reference>`!
  502. .. rst-class:: classref-item-separator
  503. ----
  504. .. _class_GraphNode_theme_style_defaultframe:
  505. .. rst-class:: classref-themeproperty
  506. :ref:`StyleBox<class_StyleBox>` **defaultframe**
  507. .. container:: contribute
  508. There is currently no description for this theme property. Please help us by :ref:`contributing one <doc_updating_the_class_reference>`!
  509. .. rst-class:: classref-item-separator
  510. ----
  511. .. _class_GraphNode_theme_style_frame:
  512. .. rst-class:: classref-themeproperty
  513. :ref:`StyleBox<class_StyleBox>` **frame**
  514. The default background for **GraphNode**.
  515. .. rst-class:: classref-item-separator
  516. ----
  517. .. _class_GraphNode_theme_style_position:
  518. .. rst-class:: classref-themeproperty
  519. :ref:`StyleBox<class_StyleBox>` **position**
  520. The background used when :ref:`overlay<class_GraphNode_property_overlay>` is set to :ref:`OVERLAY_POSITION<class_GraphNode_constant_OVERLAY_POSITION>`.
  521. .. rst-class:: classref-item-separator
  522. ----
  523. .. _class_GraphNode_theme_style_selectedframe:
  524. .. rst-class:: classref-themeproperty
  525. :ref:`StyleBox<class_StyleBox>` **selectedframe**
  526. The background used when the **GraphNode** is selected.
  527. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  528. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  529. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  530. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`