class_graphnode.rst 43 KB

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