class_graphnode.rst 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404
  1. :github_url: hide
  2. .. Generated automatically by doc/tools/makerst.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. **Category:** Core
  10. Brief Description
  11. -----------------
  12. A GraphNode is a container with several input and output slots allowing connections between GraphNodes. Slots can have different, incompatible types.
  13. Properties
  14. ----------
  15. +----------------------------------------+--------------------------------------------------------+
  16. | :ref:`bool<class_bool>` | :ref:`comment<class_GraphNode_property_comment>` |
  17. +----------------------------------------+--------------------------------------------------------+
  18. | :ref:`Vector2<class_Vector2>` | :ref:`offset<class_GraphNode_property_offset>` |
  19. +----------------------------------------+--------------------------------------------------------+
  20. | :ref:`Overlay<enum_GraphNode_Overlay>` | :ref:`overlay<class_GraphNode_property_overlay>` |
  21. +----------------------------------------+--------------------------------------------------------+
  22. | :ref:`bool<class_bool>` | :ref:`resizable<class_GraphNode_property_resizable>` |
  23. +----------------------------------------+--------------------------------------------------------+
  24. | :ref:`bool<class_bool>` | :ref:`selected<class_GraphNode_property_selected>` |
  25. +----------------------------------------+--------------------------------------------------------+
  26. | :ref:`bool<class_bool>` | :ref:`show_close<class_GraphNode_property_show_close>` |
  27. +----------------------------------------+--------------------------------------------------------+
  28. | :ref:`String<class_String>` | :ref:`title<class_GraphNode_property_title>` |
  29. +----------------------------------------+--------------------------------------------------------+
  30. Methods
  31. -------
  32. +-------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  33. | void | :ref:`clear_all_slots<class_GraphNode_method_clear_all_slots>` **(** **)** |
  34. +-------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  35. | void | :ref:`clear_slot<class_GraphNode_method_clear_slot>` **(** :ref:`int<class_int>` idx **)** |
  36. +-------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  37. | :ref:`Color<class_Color>` | :ref:`get_connection_input_color<class_GraphNode_method_get_connection_input_color>` **(** :ref:`int<class_int>` idx **)** |
  38. +-------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  39. | :ref:`int<class_int>` | :ref:`get_connection_input_count<class_GraphNode_method_get_connection_input_count>` **(** **)** |
  40. +-------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  41. | :ref:`Vector2<class_Vector2>` | :ref:`get_connection_input_position<class_GraphNode_method_get_connection_input_position>` **(** :ref:`int<class_int>` idx **)** |
  42. +-------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  43. | :ref:`int<class_int>` | :ref:`get_connection_input_type<class_GraphNode_method_get_connection_input_type>` **(** :ref:`int<class_int>` idx **)** |
  44. +-------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  45. | :ref:`Color<class_Color>` | :ref:`get_connection_output_color<class_GraphNode_method_get_connection_output_color>` **(** :ref:`int<class_int>` idx **)** |
  46. +-------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  47. | :ref:`int<class_int>` | :ref:`get_connection_output_count<class_GraphNode_method_get_connection_output_count>` **(** **)** |
  48. +-------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  49. | :ref:`Vector2<class_Vector2>` | :ref:`get_connection_output_position<class_GraphNode_method_get_connection_output_position>` **(** :ref:`int<class_int>` idx **)** |
  50. +-------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  51. | :ref:`int<class_int>` | :ref:`get_connection_output_type<class_GraphNode_method_get_connection_output_type>` **(** :ref:`int<class_int>` idx **)** |
  52. +-------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  53. | :ref:`Color<class_Color>` | :ref:`get_slot_color_left<class_GraphNode_method_get_slot_color_left>` **(** :ref:`int<class_int>` idx **)** const |
  54. +-------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  55. | :ref:`Color<class_Color>` | :ref:`get_slot_color_right<class_GraphNode_method_get_slot_color_right>` **(** :ref:`int<class_int>` idx **)** const |
  56. +-------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  57. | :ref:`int<class_int>` | :ref:`get_slot_type_left<class_GraphNode_method_get_slot_type_left>` **(** :ref:`int<class_int>` idx **)** const |
  58. +-------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  59. | :ref:`int<class_int>` | :ref:`get_slot_type_right<class_GraphNode_method_get_slot_type_right>` **(** :ref:`int<class_int>` idx **)** const |
  60. +-------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  61. | :ref:`bool<class_bool>` | :ref:`is_slot_enabled_left<class_GraphNode_method_is_slot_enabled_left>` **(** :ref:`int<class_int>` idx **)** const |
  62. +-------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  63. | :ref:`bool<class_bool>` | :ref:`is_slot_enabled_right<class_GraphNode_method_is_slot_enabled_right>` **(** :ref:`int<class_int>` idx **)** const |
  64. +-------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  65. | 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 **)** |
  66. +-------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  67. Theme Properties
  68. ----------------
  69. +---------------------------------+---------------+
  70. | :ref:`StyleBox<class_StyleBox>` | breakpoint |
  71. +---------------------------------+---------------+
  72. | :ref:`Texture<class_Texture>` | close |
  73. +---------------------------------+---------------+
  74. | :ref:`Color<class_Color>` | close_color |
  75. +---------------------------------+---------------+
  76. | :ref:`int<class_int>` | close_offset |
  77. +---------------------------------+---------------+
  78. | :ref:`StyleBox<class_StyleBox>` | comment |
  79. +---------------------------------+---------------+
  80. | :ref:`StyleBox<class_StyleBox>` | commentfocus |
  81. +---------------------------------+---------------+
  82. | :ref:`StyleBox<class_StyleBox>` | defaultfocus |
  83. +---------------------------------+---------------+
  84. | :ref:`StyleBox<class_StyleBox>` | defaultframe |
  85. +---------------------------------+---------------+
  86. | :ref:`StyleBox<class_StyleBox>` | frame |
  87. +---------------------------------+---------------+
  88. | :ref:`Texture<class_Texture>` | port |
  89. +---------------------------------+---------------+
  90. | :ref:`int<class_int>` | port_offset |
  91. +---------------------------------+---------------+
  92. | :ref:`StyleBox<class_StyleBox>` | position |
  93. +---------------------------------+---------------+
  94. | :ref:`Texture<class_Texture>` | resizer |
  95. +---------------------------------+---------------+
  96. | :ref:`StyleBox<class_StyleBox>` | selectedframe |
  97. +---------------------------------+---------------+
  98. | :ref:`int<class_int>` | separation |
  99. +---------------------------------+---------------+
  100. | :ref:`Color<class_Color>` | title_color |
  101. +---------------------------------+---------------+
  102. | :ref:`Font<class_Font>` | title_font |
  103. +---------------------------------+---------------+
  104. | :ref:`int<class_int>` | title_offset |
  105. +---------------------------------+---------------+
  106. Signals
  107. -------
  108. .. _class_GraphNode_signal_close_request:
  109. - **close_request** **(** **)**
  110. Signal sent on closing the GraphNode.
  111. ----
  112. .. _class_GraphNode_signal_dragged:
  113. - **dragged** **(** :ref:`Vector2<class_Vector2>` from, :ref:`Vector2<class_Vector2>` to **)**
  114. Signal sent when the GraphNode is dragged.
  115. ----
  116. .. _class_GraphNode_signal_offset_changed:
  117. - **offset_changed** **(** **)**
  118. Signal sent when the GraphNode is moved.
  119. ----
  120. .. _class_GraphNode_signal_raise_request:
  121. - **raise_request** **(** **)**
  122. Signal sent when the GraphNode is requested to be displayed over other ones. Happens on focusing (clicking into) the GraphNode.
  123. ----
  124. .. _class_GraphNode_signal_resize_request:
  125. - **resize_request** **(** :ref:`Vector2<class_Vector2>` new_minsize **)**
  126. Enumerations
  127. ------------
  128. .. _enum_GraphNode_Overlay:
  129. .. _class_GraphNode_constant_OVERLAY_DISABLED:
  130. .. _class_GraphNode_constant_OVERLAY_BREAKPOINT:
  131. .. _class_GraphNode_constant_OVERLAY_POSITION:
  132. enum **Overlay**:
  133. - **OVERLAY_DISABLED** = **0**
  134. - **OVERLAY_BREAKPOINT** = **1**
  135. - **OVERLAY_POSITION** = **2**
  136. Description
  137. -----------
  138. A GraphNode is a container defined by a title. It can have 1 or more input and output slots, which can be enabled (shown) or disabled (not shown) and have different (incompatible) types. Colors can also be assigned to slots. A tuple of input and output slots is defined for each GUI element included in the GraphNode. Input and output connections are left and right slots, but only enabled slots are counted as connections.
  139. Property Descriptions
  140. ---------------------
  141. .. _class_GraphNode_property_comment:
  142. - :ref:`bool<class_bool>` **comment**
  143. +----------+--------------------+
  144. | *Setter* | set_comment(value) |
  145. +----------+--------------------+
  146. | *Getter* | is_comment() |
  147. +----------+--------------------+
  148. ----
  149. .. _class_GraphNode_property_offset:
  150. - :ref:`Vector2<class_Vector2>` **offset**
  151. +----------+-------------------+
  152. | *Setter* | set_offset(value) |
  153. +----------+-------------------+
  154. | *Getter* | get_offset() |
  155. +----------+-------------------+
  156. The offset of the GraphNode, relative to the scroll offset of the :ref:`GraphEdit<class_GraphEdit>`. Note that you cannot use position directly, as :ref:`GraphEdit<class_GraphEdit>` is a :ref:`Container<class_Container>`.
  157. ----
  158. .. _class_GraphNode_property_overlay:
  159. - :ref:`Overlay<enum_GraphNode_Overlay>` **overlay**
  160. +----------+--------------------+
  161. | *Setter* | set_overlay(value) |
  162. +----------+--------------------+
  163. | *Getter* | get_overlay() |
  164. +----------+--------------------+
  165. ----
  166. .. _class_GraphNode_property_resizable:
  167. - :ref:`bool<class_bool>` **resizable**
  168. +----------+----------------------+
  169. | *Setter* | set_resizable(value) |
  170. +----------+----------------------+
  171. | *Getter* | is_resizable() |
  172. +----------+----------------------+
  173. ----
  174. .. _class_GraphNode_property_selected:
  175. - :ref:`bool<class_bool>` **selected**
  176. +----------+---------------------+
  177. | *Setter* | set_selected(value) |
  178. +----------+---------------------+
  179. | *Getter* | is_selected() |
  180. +----------+---------------------+
  181. ----
  182. .. _class_GraphNode_property_show_close:
  183. - :ref:`bool<class_bool>` **show_close**
  184. +----------+------------------------------+
  185. | *Setter* | set_show_close_button(value) |
  186. +----------+------------------------------+
  187. | *Getter* | is_close_button_visible() |
  188. +----------+------------------------------+
  189. ----
  190. .. _class_GraphNode_property_title:
  191. - :ref:`String<class_String>` **title**
  192. +----------+------------------+
  193. | *Setter* | set_title(value) |
  194. +----------+------------------+
  195. | *Getter* | get_title() |
  196. +----------+------------------+
  197. Method Descriptions
  198. -------------------
  199. .. _class_GraphNode_method_clear_all_slots:
  200. - void **clear_all_slots** **(** **)**
  201. Disable all input and output slots of the GraphNode.
  202. ----
  203. .. _class_GraphNode_method_clear_slot:
  204. - void **clear_slot** **(** :ref:`int<class_int>` idx **)**
  205. Disable input and output slot whose index is 'idx'.
  206. ----
  207. .. _class_GraphNode_method_get_connection_input_color:
  208. - :ref:`Color<class_Color>` **get_connection_input_color** **(** :ref:`int<class_int>` idx **)**
  209. Returns the color of the input connection 'idx'.
  210. ----
  211. .. _class_GraphNode_method_get_connection_input_count:
  212. - :ref:`int<class_int>` **get_connection_input_count** **(** **)**
  213. Returns the number of enabled input slots (connections) to the GraphNode.
  214. ----
  215. .. _class_GraphNode_method_get_connection_input_position:
  216. - :ref:`Vector2<class_Vector2>` **get_connection_input_position** **(** :ref:`int<class_int>` idx **)**
  217. Returns the position of the input connection 'idx'.
  218. ----
  219. .. _class_GraphNode_method_get_connection_input_type:
  220. - :ref:`int<class_int>` **get_connection_input_type** **(** :ref:`int<class_int>` idx **)**
  221. Returns the type of the input connection 'idx'.
  222. ----
  223. .. _class_GraphNode_method_get_connection_output_color:
  224. - :ref:`Color<class_Color>` **get_connection_output_color** **(** :ref:`int<class_int>` idx **)**
  225. Returns the color of the output connection 'idx'.
  226. ----
  227. .. _class_GraphNode_method_get_connection_output_count:
  228. - :ref:`int<class_int>` **get_connection_output_count** **(** **)**
  229. Returns the number of enabled output slots (connections) of the GraphNode.
  230. ----
  231. .. _class_GraphNode_method_get_connection_output_position:
  232. - :ref:`Vector2<class_Vector2>` **get_connection_output_position** **(** :ref:`int<class_int>` idx **)**
  233. Returns the position of the output connection 'idx'.
  234. ----
  235. .. _class_GraphNode_method_get_connection_output_type:
  236. - :ref:`int<class_int>` **get_connection_output_type** **(** :ref:`int<class_int>` idx **)**
  237. Returns the type of the output connection 'idx'.
  238. ----
  239. .. _class_GraphNode_method_get_slot_color_left:
  240. - :ref:`Color<class_Color>` **get_slot_color_left** **(** :ref:`int<class_int>` idx **)** const
  241. Returns the color set to 'idx' left (input) slot.
  242. ----
  243. .. _class_GraphNode_method_get_slot_color_right:
  244. - :ref:`Color<class_Color>` **get_slot_color_right** **(** :ref:`int<class_int>` idx **)** const
  245. Returns the color set to 'idx' right (output) slot.
  246. ----
  247. .. _class_GraphNode_method_get_slot_type_left:
  248. - :ref:`int<class_int>` **get_slot_type_left** **(** :ref:`int<class_int>` idx **)** const
  249. Returns the (integer) type of left (input) 'idx' slot.
  250. ----
  251. .. _class_GraphNode_method_get_slot_type_right:
  252. - :ref:`int<class_int>` **get_slot_type_right** **(** :ref:`int<class_int>` idx **)** const
  253. Returns the (integer) type of right (output) 'idx' slot.
  254. ----
  255. .. _class_GraphNode_method_is_slot_enabled_left:
  256. - :ref:`bool<class_bool>` **is_slot_enabled_left** **(** :ref:`int<class_int>` idx **)** const
  257. Returns ``true`` if left (input) slot 'idx' is enabled, ``false`` otherwise.
  258. ----
  259. .. _class_GraphNode_method_is_slot_enabled_right:
  260. - :ref:`bool<class_bool>` **is_slot_enabled_right** **(** :ref:`int<class_int>` idx **)** const
  261. Returns ``true`` if right (output) slot 'idx' is enabled, ``false`` otherwise.
  262. ----
  263. .. _class_GraphNode_method_set_slot:
  264. - 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 **)**