class_graphnode.rst 26 KB

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