class_graphnode.rst 34 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293
  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. Member Functions
  13. ----------------
  14. +--------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  15. | void | :ref:`clear_all_slots<class_GraphNode_clear_all_slots>` **(** **)** |
  16. +--------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  17. | void | :ref:`clear_slot<class_GraphNode_clear_slot>` **(** :ref:`int<class_int>` idx **)** |
  18. +--------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  19. | :ref:`Color<class_color>` | :ref:`get_connection_input_color<class_GraphNode_get_connection_input_color>` **(** :ref:`int<class_int>` idx **)** |
  20. +--------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  21. | :ref:`int<class_int>` | :ref:`get_connection_input_count<class_GraphNode_get_connection_input_count>` **(** **)** |
  22. +--------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  23. | :ref:`Vector2<class_vector2>` | :ref:`get_connection_input_position<class_GraphNode_get_connection_input_position>` **(** :ref:`int<class_int>` idx **)** |
  24. +--------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  25. | :ref:`int<class_int>` | :ref:`get_connection_input_type<class_GraphNode_get_connection_input_type>` **(** :ref:`int<class_int>` idx **)** |
  26. +--------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  27. | :ref:`Color<class_color>` | :ref:`get_connection_output_color<class_GraphNode_get_connection_output_color>` **(** :ref:`int<class_int>` idx **)** |
  28. +--------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  29. | :ref:`int<class_int>` | :ref:`get_connection_output_count<class_GraphNode_get_connection_output_count>` **(** **)** |
  30. +--------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  31. | :ref:`Vector2<class_vector2>` | :ref:`get_connection_output_position<class_GraphNode_get_connection_output_position>` **(** :ref:`int<class_int>` idx **)** |
  32. +--------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  33. | :ref:`int<class_int>` | :ref:`get_connection_output_type<class_GraphNode_get_connection_output_type>` **(** :ref:`int<class_int>` idx **)** |
  34. +--------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  35. | :ref:`Vector2<class_vector2>` | :ref:`get_offset<class_GraphNode_get_offset>` **(** **)** const |
  36. +--------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  37. | :ref:`int<class_int>` | :ref:`get_overlay<class_GraphNode_get_overlay>` **(** **)** const |
  38. +--------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  39. | :ref:`Color<class_color>` | :ref:`get_slot_color_left<class_GraphNode_get_slot_color_left>` **(** :ref:`int<class_int>` idx **)** const |
  40. +--------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  41. | :ref:`Color<class_color>` | :ref:`get_slot_color_right<class_GraphNode_get_slot_color_right>` **(** :ref:`int<class_int>` idx **)** const |
  42. +--------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  43. | :ref:`int<class_int>` | :ref:`get_slot_type_left<class_GraphNode_get_slot_type_left>` **(** :ref:`int<class_int>` idx **)** const |
  44. +--------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  45. | :ref:`int<class_int>` | :ref:`get_slot_type_right<class_GraphNode_get_slot_type_right>` **(** :ref:`int<class_int>` idx **)** const |
  46. +--------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  47. | :ref:`String<class_string>` | :ref:`get_title<class_GraphNode_get_title>` **(** **)** const |
  48. +--------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  49. | :ref:`bool<class_bool>` | :ref:`is_close_button_visible<class_GraphNode_is_close_button_visible>` **(** **)** const |
  50. +--------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  51. | :ref:`bool<class_bool>` | :ref:`is_comment<class_GraphNode_is_comment>` **(** **)** const |
  52. +--------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  53. | :ref:`bool<class_bool>` | :ref:`is_resizable<class_GraphNode_is_resizable>` **(** **)** const |
  54. +--------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  55. | :ref:`bool<class_bool>` | :ref:`is_selected<class_GraphNode_is_selected>` **(** **)** |
  56. +--------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  57. | :ref:`bool<class_bool>` | :ref:`is_slot_enabled_left<class_GraphNode_is_slot_enabled_left>` **(** :ref:`int<class_int>` idx **)** const |
  58. +--------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  59. | :ref:`bool<class_bool>` | :ref:`is_slot_enabled_right<class_GraphNode_is_slot_enabled_right>` **(** :ref:`int<class_int>` idx **)** const |
  60. +--------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  61. | void | :ref:`set_comment<class_GraphNode_set_comment>` **(** :ref:`bool<class_bool>` comment **)** |
  62. +--------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  63. | void | :ref:`set_offset<class_GraphNode_set_offset>` **(** :ref:`Vector2<class_vector2>` offset **)** |
  64. +--------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  65. | void | :ref:`set_overlay<class_GraphNode_set_overlay>` **(** :ref:`int<class_int>` overlay **)** |
  66. +--------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  67. | void | :ref:`set_resizable<class_GraphNode_set_resizable>` **(** :ref:`bool<class_bool>` resizable **)** |
  68. +--------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  69. | void | :ref:`set_selected<class_GraphNode_set_selected>` **(** :ref:`bool<class_bool>` selected **)** |
  70. +--------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  71. | void | :ref:`set_show_close_button<class_GraphNode_set_show_close_button>` **(** :ref:`bool<class_bool>` show **)** |
  72. +--------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  73. | void | :ref:`set_slot<class_GraphNode_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 **)** |
  74. +--------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  75. | void | :ref:`set_title<class_GraphNode_set_title>` **(** :ref:`String<class_string>` title **)** |
  76. +--------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  77. Signals
  78. -------
  79. - **close_request** **(** **)**
  80. Signal sent on closing the GraphNode.
  81. - **dragged** **(** :ref:`Vector2<class_vector2>` from, :ref:`Vector2<class_vector2>` to **)**
  82. Signal sent when the GraphNode is dragged.
  83. - **offset_changed** **(** **)**
  84. Signal sent when the GraphNode is moved.
  85. - **raise_request** **(** **)**
  86. Signal sent when the GraphNode is requested to be displayed over other ones. Happens on focusing (clicking into) the GraphNode.
  87. - **resize_request** **(** :ref:`Vector2<class_vector2>` new_minsize **)**
  88. Member Variables
  89. ----------------
  90. - :ref:`bool<class_bool>` **resizable**
  91. - :ref:`bool<class_bool>` **show_close**
  92. - :ref:`String<class_string>` **title**
  93. Numeric Constants
  94. -----------------
  95. - **OVERLAY_DISABLED** = **0**
  96. - **OVERLAY_BREAKPOINT** = **1**
  97. - **OVERLAY_POSITION** = **2**
  98. Description
  99. -----------
  100. 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.
  101. Member Function Description
  102. ---------------------------
  103. .. _class_GraphNode_clear_all_slots:
  104. - void **clear_all_slots** **(** **)**
  105. Disable all input and output slots of the GraphNode.
  106. .. _class_GraphNode_clear_slot:
  107. - void **clear_slot** **(** :ref:`int<class_int>` idx **)**
  108. Disable input and output slot whose index is 'idx'.
  109. .. _class_GraphNode_get_connection_input_color:
  110. - :ref:`Color<class_color>` **get_connection_input_color** **(** :ref:`int<class_int>` idx **)**
  111. Return the color of the input connection 'idx'.
  112. .. _class_GraphNode_get_connection_input_count:
  113. - :ref:`int<class_int>` **get_connection_input_count** **(** **)**
  114. Return the number of enabled input slots (connections) to the GraphNode.
  115. .. _class_GraphNode_get_connection_input_position:
  116. - :ref:`Vector2<class_vector2>` **get_connection_input_position** **(** :ref:`int<class_int>` idx **)**
  117. Return the position of the input connection 'idx'.
  118. .. _class_GraphNode_get_connection_input_type:
  119. - :ref:`int<class_int>` **get_connection_input_type** **(** :ref:`int<class_int>` idx **)**
  120. Return the type of the input connection 'idx'.
  121. .. _class_GraphNode_get_connection_output_color:
  122. - :ref:`Color<class_color>` **get_connection_output_color** **(** :ref:`int<class_int>` idx **)**
  123. Return the color of the output connection 'idx'.
  124. .. _class_GraphNode_get_connection_output_count:
  125. - :ref:`int<class_int>` **get_connection_output_count** **(** **)**
  126. Return the number of enabled output slots (connections) of the GraphNode.
  127. .. _class_GraphNode_get_connection_output_position:
  128. - :ref:`Vector2<class_vector2>` **get_connection_output_position** **(** :ref:`int<class_int>` idx **)**
  129. Return the position of the output connection 'idx'.
  130. .. _class_GraphNode_get_connection_output_type:
  131. - :ref:`int<class_int>` **get_connection_output_type** **(** :ref:`int<class_int>` idx **)**
  132. Return the type of the output connection 'idx'.
  133. .. _class_GraphNode_get_offset:
  134. - :ref:`Vector2<class_vector2>` **get_offset** **(** **)** const
  135. Return the offset of the GraphNode.
  136. .. _class_GraphNode_get_overlay:
  137. - :ref:`int<class_int>` **get_overlay** **(** **)** const
  138. .. _class_GraphNode_get_slot_color_left:
  139. - :ref:`Color<class_color>` **get_slot_color_left** **(** :ref:`int<class_int>` idx **)** const
  140. Return the color set to 'idx' left (input) slot.
  141. .. _class_GraphNode_get_slot_color_right:
  142. - :ref:`Color<class_color>` **get_slot_color_right** **(** :ref:`int<class_int>` idx **)** const
  143. Return the color set to 'idx' right (output) slot.
  144. .. _class_GraphNode_get_slot_type_left:
  145. - :ref:`int<class_int>` **get_slot_type_left** **(** :ref:`int<class_int>` idx **)** const
  146. Return the (integer) type of left (input) 'idx' slot.
  147. .. _class_GraphNode_get_slot_type_right:
  148. - :ref:`int<class_int>` **get_slot_type_right** **(** :ref:`int<class_int>` idx **)** const
  149. Return the (integer) type of right (output) 'idx' slot.
  150. .. _class_GraphNode_get_title:
  151. - :ref:`String<class_string>` **get_title** **(** **)** const
  152. Return the title of the GraphNode.
  153. .. _class_GraphNode_is_close_button_visible:
  154. - :ref:`bool<class_bool>` **is_close_button_visible** **(** **)** const
  155. Returns true if the close button is shown. False otherwise.
  156. .. _class_GraphNode_is_comment:
  157. - :ref:`bool<class_bool>` **is_comment** **(** **)** const
  158. .. _class_GraphNode_is_resizable:
  159. - :ref:`bool<class_bool>` **is_resizable** **(** **)** const
  160. .. _class_GraphNode_is_selected:
  161. - :ref:`bool<class_bool>` **is_selected** **(** **)**
  162. .. _class_GraphNode_is_slot_enabled_left:
  163. - :ref:`bool<class_bool>` **is_slot_enabled_left** **(** :ref:`int<class_int>` idx **)** const
  164. Return true if left (input) slot 'idx' is enabled. False otherwise.
  165. .. _class_GraphNode_is_slot_enabled_right:
  166. - :ref:`bool<class_bool>` **is_slot_enabled_right** **(** :ref:`int<class_int>` idx **)** const
  167. Return true if right (output) slot 'idx' is enabled. False otherwise.
  168. .. _class_GraphNode_set_comment:
  169. - void **set_comment** **(** :ref:`bool<class_bool>` comment **)**
  170. .. _class_GraphNode_set_offset:
  171. - void **set_offset** **(** :ref:`Vector2<class_vector2>` offset **)**
  172. Set the offset of the GraphNode.
  173. .. _class_GraphNode_set_overlay:
  174. - void **set_overlay** **(** :ref:`int<class_int>` overlay **)**
  175. .. _class_GraphNode_set_resizable:
  176. - void **set_resizable** **(** :ref:`bool<class_bool>` resizable **)**
  177. .. _class_GraphNode_set_selected:
  178. - void **set_selected** **(** :ref:`bool<class_bool>` selected **)**
  179. .. _class_GraphNode_set_show_close_button:
  180. - void **set_show_close_button** **(** :ref:`bool<class_bool>` show **)**
  181. Show the close button on the GraphNode if 'show' is true (disabled by default). If enabled, a connection on the signal close_request is needed for the close button to work.
  182. .. _class_GraphNode_set_slot:
  183. - 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 **)**
  184. .. _class_GraphNode_set_title:
  185. - void **set_title** **(** :ref:`String<class_string>` title **)**
  186. Set the title of the GraphNode.