class_graphnode.rst 48 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959
  1. :github_url: hide
  2. .. DO NOT EDIT THIS FILE!!!
  3. .. Generated automatically from Godot engine sources.
  4. .. Generator: https://github.com/godotengine/godot/tree/3.6/doc/tools/make_rst.py.
  5. .. XML source: https://github.com/godotengine/godot/tree/3.6/doc/classes/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_selected:
  169. .. rst-class:: classref-signal
  170. **selected** **(** **)**
  171. Emitted when the GraphNode is selected.
  172. .. rst-class:: classref-item-separator
  173. ----
  174. .. _class_GraphNode_signal_slot_updated:
  175. .. rst-class:: classref-signal
  176. **slot_updated** **(** :ref:`int<class_int>` idx **)**
  177. Emitted when any GraphNode's slot is updated.
  178. .. rst-class:: classref-item-separator
  179. ----
  180. .. _class_GraphNode_signal_unselected:
  181. .. rst-class:: classref-signal
  182. **unselected** **(** **)**
  183. Emitted when the GraphNode is unselected.
  184. .. rst-class:: classref-section-separator
  185. ----
  186. .. rst-class:: classref-descriptions-group
  187. Enumerations
  188. ------------
  189. .. _enum_GraphNode_Overlay:
  190. .. rst-class:: classref-enumeration
  191. enum **Overlay**:
  192. .. _class_GraphNode_constant_OVERLAY_DISABLED:
  193. .. rst-class:: classref-enumeration-constant
  194. :ref:`Overlay<enum_GraphNode_Overlay>` **OVERLAY_DISABLED** = ``0``
  195. No overlay is shown.
  196. .. _class_GraphNode_constant_OVERLAY_BREAKPOINT:
  197. .. rst-class:: classref-enumeration-constant
  198. :ref:`Overlay<enum_GraphNode_Overlay>` **OVERLAY_BREAKPOINT** = ``1``
  199. Show overlay set in the ``breakpoint`` theme property.
  200. .. _class_GraphNode_constant_OVERLAY_POSITION:
  201. .. rst-class:: classref-enumeration-constant
  202. :ref:`Overlay<enum_GraphNode_Overlay>` **OVERLAY_POSITION** = ``2``
  203. Show overlay set in the ``position`` theme property.
  204. .. rst-class:: classref-section-separator
  205. ----
  206. .. rst-class:: classref-descriptions-group
  207. Property Descriptions
  208. ---------------------
  209. .. _class_GraphNode_property_comment:
  210. .. rst-class:: classref-property
  211. :ref:`bool<class_bool>` **comment** = ``false``
  212. .. rst-class:: classref-property-setget
  213. - void **set_comment** **(** :ref:`bool<class_bool>` value **)**
  214. - :ref:`bool<class_bool>` **is_comment** **(** **)**
  215. If ``true``, the GraphNode is a comment node.
  216. .. rst-class:: classref-item-separator
  217. ----
  218. .. _class_GraphNode_property_offset:
  219. .. rst-class:: classref-property
  220. :ref:`Vector2<class_Vector2>` **offset** = ``Vector2( 0, 0 )``
  221. .. rst-class:: classref-property-setget
  222. - void **set_offset** **(** :ref:`Vector2<class_Vector2>` value **)**
  223. - :ref:`Vector2<class_Vector2>` **get_offset** **(** **)**
  224. The offset of the GraphNode, relative to the scroll offset of the :ref:`GraphEdit<class_GraphEdit>`.
  225. \ **Note:** You cannot use position directly, as :ref:`GraphEdit<class_GraphEdit>` is a :ref:`Container<class_Container>`.
  226. .. rst-class:: classref-item-separator
  227. ----
  228. .. _class_GraphNode_property_overlay:
  229. .. rst-class:: classref-property
  230. :ref:`Overlay<enum_GraphNode_Overlay>` **overlay** = ``0``
  231. .. rst-class:: classref-property-setget
  232. - void **set_overlay** **(** :ref:`Overlay<enum_GraphNode_Overlay>` value **)**
  233. - :ref:`Overlay<enum_GraphNode_Overlay>` **get_overlay** **(** **)**
  234. Sets the overlay shown above the GraphNode. See :ref:`Overlay<enum_GraphNode_Overlay>`.
  235. .. rst-class:: classref-item-separator
  236. ----
  237. .. _class_GraphNode_property_resizable:
  238. .. rst-class:: classref-property
  239. :ref:`bool<class_bool>` **resizable** = ``false``
  240. .. rst-class:: classref-property-setget
  241. - void **set_resizable** **(** :ref:`bool<class_bool>` value **)**
  242. - :ref:`bool<class_bool>` **is_resizable** **(** **)**
  243. If ``true``, the user can resize the GraphNode.
  244. \ **Note:** Dragging the handle will only emit the :ref:`resize_request<class_GraphNode_signal_resize_request>` signal, the GraphNode needs to be resized manually.
  245. .. rst-class:: classref-item-separator
  246. ----
  247. .. _class_GraphNode_property_selected:
  248. .. rst-class:: classref-property
  249. :ref:`bool<class_bool>` **selected** = ``false``
  250. .. rst-class:: classref-property-setget
  251. - void **set_selected** **(** :ref:`bool<class_bool>` value **)**
  252. - :ref:`bool<class_bool>` **is_selected** **(** **)**
  253. If ``true``, the GraphNode is selected.
  254. .. rst-class:: classref-item-separator
  255. ----
  256. .. _class_GraphNode_property_show_close:
  257. .. rst-class:: classref-property
  258. :ref:`bool<class_bool>` **show_close** = ``false``
  259. .. rst-class:: classref-property-setget
  260. - void **set_show_close_button** **(** :ref:`bool<class_bool>` value **)**
  261. - :ref:`bool<class_bool>` **is_close_button_visible** **(** **)**
  262. If ``true``, the close button will be visible.
  263. \ **Note:** Pressing it will only emit the :ref:`close_request<class_GraphNode_signal_close_request>` signal, the GraphNode needs to be removed manually.
  264. .. rst-class:: classref-item-separator
  265. ----
  266. .. _class_GraphNode_property_title:
  267. .. rst-class:: classref-property
  268. :ref:`String<class_String>` **title** = ``""``
  269. .. rst-class:: classref-property-setget
  270. - void **set_title** **(** :ref:`String<class_String>` value **)**
  271. - :ref:`String<class_String>` **get_title** **(** **)**
  272. The text displayed in the GraphNode's title bar.
  273. .. rst-class:: classref-section-separator
  274. ----
  275. .. rst-class:: classref-descriptions-group
  276. Method Descriptions
  277. -------------------
  278. .. _class_GraphNode_method_clear_all_slots:
  279. .. rst-class:: classref-method
  280. void **clear_all_slots** **(** **)**
  281. Disables all input and output slots of the GraphNode.
  282. .. rst-class:: classref-item-separator
  283. ----
  284. .. _class_GraphNode_method_clear_slot:
  285. .. rst-class:: classref-method
  286. void **clear_slot** **(** :ref:`int<class_int>` idx **)**
  287. Disables input and output slot whose index is ``idx``.
  288. .. rst-class:: classref-item-separator
  289. ----
  290. .. _class_GraphNode_method_get_connection_input_color:
  291. .. rst-class:: classref-method
  292. :ref:`Color<class_Color>` **get_connection_input_color** **(** :ref:`int<class_int>` idx **)**
  293. Returns the :ref:`Color<class_Color>` of the input connection ``idx``.
  294. .. rst-class:: classref-item-separator
  295. ----
  296. .. _class_GraphNode_method_get_connection_input_count:
  297. .. rst-class:: classref-method
  298. :ref:`int<class_int>` **get_connection_input_count** **(** **)**
  299. Returns the number of enabled input slots (connections) to the GraphNode.
  300. .. rst-class:: classref-item-separator
  301. ----
  302. .. _class_GraphNode_method_get_connection_input_position:
  303. .. rst-class:: classref-method
  304. :ref:`Vector2<class_Vector2>` **get_connection_input_position** **(** :ref:`int<class_int>` idx **)**
  305. Returns the position of the input connection ``idx``.
  306. .. rst-class:: classref-item-separator
  307. ----
  308. .. _class_GraphNode_method_get_connection_input_type:
  309. .. rst-class:: classref-method
  310. :ref:`int<class_int>` **get_connection_input_type** **(** :ref:`int<class_int>` idx **)**
  311. Returns the type of the input connection ``idx``.
  312. .. rst-class:: classref-item-separator
  313. ----
  314. .. _class_GraphNode_method_get_connection_output_color:
  315. .. rst-class:: classref-method
  316. :ref:`Color<class_Color>` **get_connection_output_color** **(** :ref:`int<class_int>` idx **)**
  317. Returns the :ref:`Color<class_Color>` of the output connection ``idx``.
  318. .. rst-class:: classref-item-separator
  319. ----
  320. .. _class_GraphNode_method_get_connection_output_count:
  321. .. rst-class:: classref-method
  322. :ref:`int<class_int>` **get_connection_output_count** **(** **)**
  323. Returns the number of enabled output slots (connections) of the GraphNode.
  324. .. rst-class:: classref-item-separator
  325. ----
  326. .. _class_GraphNode_method_get_connection_output_position:
  327. .. rst-class:: classref-method
  328. :ref:`Vector2<class_Vector2>` **get_connection_output_position** **(** :ref:`int<class_int>` idx **)**
  329. Returns the position of the output connection ``idx``.
  330. .. rst-class:: classref-item-separator
  331. ----
  332. .. _class_GraphNode_method_get_connection_output_type:
  333. .. rst-class:: classref-method
  334. :ref:`int<class_int>` **get_connection_output_type** **(** :ref:`int<class_int>` idx **)**
  335. Returns the type of the output connection ``idx``.
  336. .. rst-class:: classref-item-separator
  337. ----
  338. .. _class_GraphNode_method_get_slot_color_left:
  339. .. rst-class:: classref-method
  340. :ref:`Color<class_Color>` **get_slot_color_left** **(** :ref:`int<class_int>` idx **)** |const|
  341. Returns the left (input) :ref:`Color<class_Color>` of the slot ``idx``.
  342. .. rst-class:: classref-item-separator
  343. ----
  344. .. _class_GraphNode_method_get_slot_color_right:
  345. .. rst-class:: classref-method
  346. :ref:`Color<class_Color>` **get_slot_color_right** **(** :ref:`int<class_int>` idx **)** |const|
  347. Returns the right (output) :ref:`Color<class_Color>` of the slot ``idx``.
  348. .. rst-class:: classref-item-separator
  349. ----
  350. .. _class_GraphNode_method_get_slot_type_left:
  351. .. rst-class:: classref-method
  352. :ref:`int<class_int>` **get_slot_type_left** **(** :ref:`int<class_int>` idx **)** |const|
  353. Returns the left (input) type of the slot ``idx``.
  354. .. rst-class:: classref-item-separator
  355. ----
  356. .. _class_GraphNode_method_get_slot_type_right:
  357. .. rst-class:: classref-method
  358. :ref:`int<class_int>` **get_slot_type_right** **(** :ref:`int<class_int>` idx **)** |const|
  359. Returns the right (output) type of the slot ``idx``.
  360. .. rst-class:: classref-item-separator
  361. ----
  362. .. _class_GraphNode_method_is_slot_enabled_left:
  363. .. rst-class:: classref-method
  364. :ref:`bool<class_bool>` **is_slot_enabled_left** **(** :ref:`int<class_int>` idx **)** |const|
  365. Returns ``true`` if left (input) side of the slot ``idx`` is enabled.
  366. .. rst-class:: classref-item-separator
  367. ----
  368. .. _class_GraphNode_method_is_slot_enabled_right:
  369. .. rst-class:: classref-method
  370. :ref:`bool<class_bool>` **is_slot_enabled_right** **(** :ref:`int<class_int>` idx **)** |const|
  371. Returns ``true`` if right (output) side of the slot ``idx`` is enabled.
  372. .. rst-class:: classref-item-separator
  373. ----
  374. .. _class_GraphNode_method_set_slot:
  375. .. rst-class:: classref-method
  376. 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 **)**
  377. Sets properties of the slot with ID ``idx``.
  378. If ``enable_left``/``right``, a port will appear and the slot will be able to be connected from this side.
  379. \ ``type_left``/``right`` is an arbitrary type of the port. Only ports with the same type values can be connected.
  380. \ ``color_left``/``right`` is the tint of the port's icon on this side.
  381. \ ``custom_left``/``right`` is a custom texture for this side's port.
  382. \ **Note:** This method only sets properties of the slot. To create the slot, add a :ref:`Control<class_Control>`-derived child to the GraphNode.
  383. 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.
  384. .. rst-class:: classref-item-separator
  385. ----
  386. .. _class_GraphNode_method_set_slot_color_left:
  387. .. rst-class:: classref-method
  388. void **set_slot_color_left** **(** :ref:`int<class_int>` idx, :ref:`Color<class_Color>` color_left **)**
  389. Sets the :ref:`Color<class_Color>` of the left (input) side of the slot ``idx`` to ``color_left``.
  390. .. rst-class:: classref-item-separator
  391. ----
  392. .. _class_GraphNode_method_set_slot_color_right:
  393. .. rst-class:: classref-method
  394. void **set_slot_color_right** **(** :ref:`int<class_int>` idx, :ref:`Color<class_Color>` color_right **)**
  395. Sets the :ref:`Color<class_Color>` of the right (output) side of the slot ``idx`` to ``color_right``.
  396. .. rst-class:: classref-item-separator
  397. ----
  398. .. _class_GraphNode_method_set_slot_enabled_left:
  399. .. rst-class:: classref-method
  400. void **set_slot_enabled_left** **(** :ref:`int<class_int>` idx, :ref:`bool<class_bool>` enable_left **)**
  401. 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.
  402. .. rst-class:: classref-item-separator
  403. ----
  404. .. _class_GraphNode_method_set_slot_enabled_right:
  405. .. rst-class:: classref-method
  406. void **set_slot_enabled_right** **(** :ref:`int<class_int>` idx, :ref:`bool<class_bool>` enable_right **)**
  407. 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.
  408. .. rst-class:: classref-item-separator
  409. ----
  410. .. _class_GraphNode_method_set_slot_type_left:
  411. .. rst-class:: classref-method
  412. void **set_slot_type_left** **(** :ref:`int<class_int>` idx, :ref:`int<class_int>` type_left **)**
  413. Sets the left (input) type of the slot ``idx`` to ``type_left``.
  414. .. rst-class:: classref-item-separator
  415. ----
  416. .. _class_GraphNode_method_set_slot_type_right:
  417. .. rst-class:: classref-method
  418. void **set_slot_type_right** **(** :ref:`int<class_int>` idx, :ref:`int<class_int>` type_right **)**
  419. Sets the right (output) type of the slot ``idx`` to ``type_right``.
  420. .. rst-class:: classref-section-separator
  421. ----
  422. .. rst-class:: classref-descriptions-group
  423. Theme Property Descriptions
  424. ---------------------------
  425. .. _class_GraphNode_theme_color_close_color:
  426. .. rst-class:: classref-themeproperty
  427. :ref:`Color<class_Color>` **close_color** = ``Color( 0, 0, 0, 1 )``
  428. The color modulation applied to the close button icon.
  429. .. rst-class:: classref-item-separator
  430. ----
  431. .. _class_GraphNode_theme_color_resizer_color:
  432. .. rst-class:: classref-themeproperty
  433. :ref:`Color<class_Color>` **resizer_color** = ``Color( 0, 0, 0, 1 )``
  434. The color modulation applied to the resizer icon.
  435. .. rst-class:: classref-item-separator
  436. ----
  437. .. _class_GraphNode_theme_color_title_color:
  438. .. rst-class:: classref-themeproperty
  439. :ref:`Color<class_Color>` **title_color** = ``Color( 0, 0, 0, 1 )``
  440. Color of the title text.
  441. .. rst-class:: classref-item-separator
  442. ----
  443. .. _class_GraphNode_theme_constant_close_offset:
  444. .. rst-class:: classref-themeproperty
  445. :ref:`int<class_int>` **close_offset** = ``18``
  446. The vertical offset of the close button.
  447. .. rst-class:: classref-item-separator
  448. ----
  449. .. _class_GraphNode_theme_constant_port_offset:
  450. .. rst-class:: classref-themeproperty
  451. :ref:`int<class_int>` **port_offset** = ``3``
  452. Horizontal offset for the ports.
  453. .. rst-class:: classref-item-separator
  454. ----
  455. .. _class_GraphNode_theme_constant_separation:
  456. .. rst-class:: classref-themeproperty
  457. :ref:`int<class_int>` **separation** = ``1``
  458. The vertical distance between ports.
  459. .. rst-class:: classref-item-separator
  460. ----
  461. .. _class_GraphNode_theme_constant_title_offset:
  462. .. rst-class:: classref-themeproperty
  463. :ref:`int<class_int>` **title_offset** = ``20``
  464. Vertical offset of the title text.
  465. .. rst-class:: classref-item-separator
  466. ----
  467. .. _class_GraphNode_theme_font_title_font:
  468. .. rst-class:: classref-themeproperty
  469. :ref:`Font<class_Font>` **title_font**
  470. Font used for the title text.
  471. .. rst-class:: classref-item-separator
  472. ----
  473. .. _class_GraphNode_theme_icon_close:
  474. .. rst-class:: classref-themeproperty
  475. :ref:`Texture<class_Texture>` **close**
  476. The icon for the close button, visible when :ref:`show_close<class_GraphNode_property_show_close>` is enabled.
  477. .. rst-class:: classref-item-separator
  478. ----
  479. .. _class_GraphNode_theme_icon_port:
  480. .. rst-class:: classref-themeproperty
  481. :ref:`Texture<class_Texture>` **port**
  482. The icon used for representing ports.
  483. .. rst-class:: classref-item-separator
  484. ----
  485. .. _class_GraphNode_theme_icon_resizer:
  486. .. rst-class:: classref-themeproperty
  487. :ref:`Texture<class_Texture>` **resizer**
  488. The icon used for resizer, visible when :ref:`resizable<class_GraphNode_property_resizable>` is enabled.
  489. .. rst-class:: classref-item-separator
  490. ----
  491. .. _class_GraphNode_theme_style_breakpoint:
  492. .. rst-class:: classref-themeproperty
  493. :ref:`StyleBox<class_StyleBox>` **breakpoint**
  494. The background used when :ref:`overlay<class_GraphNode_property_overlay>` is set to :ref:`OVERLAY_BREAKPOINT<class_GraphNode_constant_OVERLAY_BREAKPOINT>`.
  495. .. rst-class:: classref-item-separator
  496. ----
  497. .. _class_GraphNode_theme_style_comment:
  498. .. rst-class:: classref-themeproperty
  499. :ref:`StyleBox<class_StyleBox>` **comment**
  500. The :ref:`StyleBox<class_StyleBox>` used when :ref:`comment<class_GraphNode_property_comment>` is enabled.
  501. .. rst-class:: classref-item-separator
  502. ----
  503. .. _class_GraphNode_theme_style_commentfocus:
  504. .. rst-class:: classref-themeproperty
  505. :ref:`StyleBox<class_StyleBox>` **commentfocus**
  506. The :ref:`StyleBox<class_StyleBox>` used when :ref:`comment<class_GraphNode_property_comment>` is enabled and the **GraphNode** is focused.
  507. .. rst-class:: classref-item-separator
  508. ----
  509. .. _class_GraphNode_theme_style_defaultfocus:
  510. .. rst-class:: classref-themeproperty
  511. :ref:`StyleBox<class_StyleBox>` **defaultfocus**
  512. .. container:: contribute
  513. There is currently no description for this theme property. Please help us by :ref:`contributing one <doc_updating_the_class_reference>`!
  514. .. rst-class:: classref-item-separator
  515. ----
  516. .. _class_GraphNode_theme_style_defaultframe:
  517. .. rst-class:: classref-themeproperty
  518. :ref:`StyleBox<class_StyleBox>` **defaultframe**
  519. .. container:: contribute
  520. There is currently no description for this theme property. Please help us by :ref:`contributing one <doc_updating_the_class_reference>`!
  521. .. rst-class:: classref-item-separator
  522. ----
  523. .. _class_GraphNode_theme_style_frame:
  524. .. rst-class:: classref-themeproperty
  525. :ref:`StyleBox<class_StyleBox>` **frame**
  526. The default background for **GraphNode**.
  527. .. rst-class:: classref-item-separator
  528. ----
  529. .. _class_GraphNode_theme_style_position:
  530. .. rst-class:: classref-themeproperty
  531. :ref:`StyleBox<class_StyleBox>` **position**
  532. The background used when :ref:`overlay<class_GraphNode_property_overlay>` is set to :ref:`OVERLAY_POSITION<class_GraphNode_constant_OVERLAY_POSITION>`.
  533. .. rst-class:: classref-item-separator
  534. ----
  535. .. _class_GraphNode_theme_style_selectedframe:
  536. .. rst-class:: classref-themeproperty
  537. :ref:`StyleBox<class_StyleBox>` **selectedframe**
  538. The background used when the **GraphNode** is selected.
  539. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  540. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  541. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  542. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`