class_graphnode.rst 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223
  1. .. Generated automatically by doc/tools/makerst.py in Godot's source tree.
  2. .. DO NOT EDIT THIS FILE, but the doc/base/classes.xml source instead.
  3. .. _class_GraphNode:
  4. GraphNode
  5. =========
  6. **Inherits:** :ref:`Container<class_container>` **<** :ref:`Control<class_control>` **<** :ref:`CanvasItem<class_canvasitem>` **<** :ref:`Node<class_node>` **<** :ref:`Object<class_object>`
  7. **Category:** Core
  8. Brief Description
  9. -----------------
  10. A GraphNode is a container with several input and output slots allowing connections between GraphNodes. Slots can have different, incompatible types.
  11. Member Functions
  12. ----------------
  13. +--------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  14. | void | :ref:`set_title<class_GraphNode_set_title>` **(** :ref:`String<class_string>` title **)** |
  15. +--------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  16. | :ref:`String<class_string>` | :ref:`get_title<class_GraphNode_get_title>` **(** **)** const |
  17. +--------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  18. | 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 **)** |
  19. +--------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  20. | void | :ref:`clear_slot<class_GraphNode_clear_slot>` **(** :ref:`int<class_int>` idx **)** |
  21. +--------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  22. | void | :ref:`clear_all_slots<class_GraphNode_clear_all_slots>` **(** **)** |
  23. +--------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  24. | :ref:`bool<class_bool>` | :ref:`is_slot_enabled_left<class_GraphNode_is_slot_enabled_left>` **(** :ref:`int<class_int>` idx **)** const |
  25. +--------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  26. | :ref:`int<class_int>` | :ref:`get_slot_type_left<class_GraphNode_get_slot_type_left>` **(** :ref:`int<class_int>` idx **)** const |
  27. +--------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  28. | :ref:`Color<class_color>` | :ref:`get_slot_color_left<class_GraphNode_get_slot_color_left>` **(** :ref:`int<class_int>` idx **)** const |
  29. +--------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  30. | :ref:`bool<class_bool>` | :ref:`is_slot_enabled_right<class_GraphNode_is_slot_enabled_right>` **(** :ref:`int<class_int>` idx **)** const |
  31. +--------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  32. | :ref:`int<class_int>` | :ref:`get_slot_type_right<class_GraphNode_get_slot_type_right>` **(** :ref:`int<class_int>` idx **)** const |
  33. +--------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  34. | :ref:`Color<class_color>` | :ref:`get_slot_color_right<class_GraphNode_get_slot_color_right>` **(** :ref:`int<class_int>` idx **)** const |
  35. +--------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  36. | void | :ref:`set_offset<class_GraphNode_set_offset>` **(** :ref:`Vector2<class_vector2>` offset **)** |
  37. +--------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  38. | :ref:`Vector2<class_vector2>` | :ref:`get_offset<class_GraphNode_get_offset>` **(** **)** const |
  39. +--------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  40. | :ref:`int<class_int>` | :ref:`get_connection_output_count<class_GraphNode_get_connection_output_count>` **(** **)** |
  41. +--------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  42. | :ref:`int<class_int>` | :ref:`get_connection_input_count<class_GraphNode_get_connection_input_count>` **(** **)** |
  43. +--------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  44. | :ref:`Vector2<class_vector2>` | :ref:`get_connection_output_pos<class_GraphNode_get_connection_output_pos>` **(** :ref:`int<class_int>` idx **)** |
  45. +--------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  46. | :ref:`int<class_int>` | :ref:`get_connection_output_type<class_GraphNode_get_connection_output_type>` **(** :ref:`int<class_int>` idx **)** |
  47. +--------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  48. | :ref:`Color<class_color>` | :ref:`get_connection_output_color<class_GraphNode_get_connection_output_color>` **(** :ref:`int<class_int>` idx **)** |
  49. +--------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  50. | :ref:`Vector2<class_vector2>` | :ref:`get_connection_input_pos<class_GraphNode_get_connection_input_pos>` **(** :ref:`int<class_int>` idx **)** |
  51. +--------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  52. | :ref:`int<class_int>` | :ref:`get_connection_input_type<class_GraphNode_get_connection_input_type>` **(** :ref:`int<class_int>` idx **)** |
  53. +--------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  54. | :ref:`Color<class_color>` | :ref:`get_connection_input_color<class_GraphNode_get_connection_input_color>` **(** :ref:`int<class_int>` idx **)** |
  55. +--------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  56. | void | :ref:`set_show_close_button<class_GraphNode_set_show_close_button>` **(** :ref:`bool<class_bool>` show **)** |
  57. +--------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  58. | :ref:`bool<class_bool>` | :ref:`is_close_button_visible<class_GraphNode_is_close_button_visible>` **(** **)** const |
  59. +--------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  60. Signals
  61. -------
  62. - **raise_request** **(** **)**
  63. - **close_request** **(** **)**
  64. - **dragged** **(** :ref:`Vector2<class_vector2>` from, :ref:`Vector2<class_vector2>` to **)**
  65. - **offset_changed** **(** **)**
  66. Description
  67. -----------
  68. 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.
  69. Member Function Description
  70. ---------------------------
  71. .. _class_GraphNode_set_title:
  72. - void **set_title** **(** :ref:`String<class_string>` title **)**
  73. Set the title of the GraphNode.
  74. .. _class_GraphNode_get_title:
  75. - :ref:`String<class_string>` **get_title** **(** **)** const
  76. Return the title of the GraphNode.
  77. .. _class_GraphNode_set_slot:
  78. - 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 **)**
  79. Set the tuple of input/output slots defined by 'idx' ID. 'left' slots are input, 'right' are output. 'type' is an integer defining the type of the slot. Refer to description for the compatibility between slot types.
  80. .. _class_GraphNode_clear_slot:
  81. - void **clear_slot** **(** :ref:`int<class_int>` idx **)**
  82. Disable input and output slot whose index is 'idx'.
  83. .. _class_GraphNode_clear_all_slots:
  84. - void **clear_all_slots** **(** **)**
  85. Disable all input and output slots of the GraphNode.
  86. .. _class_GraphNode_is_slot_enabled_left:
  87. - :ref:`bool<class_bool>` **is_slot_enabled_left** **(** :ref:`int<class_int>` idx **)** const
  88. Return true if left (input) slot 'idx' is enabled. False otherwise.
  89. .. _class_GraphNode_get_slot_type_left:
  90. - :ref:`int<class_int>` **get_slot_type_left** **(** :ref:`int<class_int>` idx **)** const
  91. Return the (integer) type of left (input) 'idx' slot.
  92. .. _class_GraphNode_get_slot_color_left:
  93. - :ref:`Color<class_color>` **get_slot_color_left** **(** :ref:`int<class_int>` idx **)** const
  94. Return the color set to 'idx' left (input) slot.
  95. .. _class_GraphNode_is_slot_enabled_right:
  96. - :ref:`bool<class_bool>` **is_slot_enabled_right** **(** :ref:`int<class_int>` idx **)** const
  97. Return true if right (output) slot 'idx' is enabled. False otherwise.
  98. .. _class_GraphNode_get_slot_type_right:
  99. - :ref:`int<class_int>` **get_slot_type_right** **(** :ref:`int<class_int>` idx **)** const
  100. Return the (integer) type of right (output) 'idx' slot.
  101. .. _class_GraphNode_get_slot_color_right:
  102. - :ref:`Color<class_color>` **get_slot_color_right** **(** :ref:`int<class_int>` idx **)** const
  103. Return the color set to 'idx' right (output) slot.
  104. .. _class_GraphNode_set_offset:
  105. - void **set_offset** **(** :ref:`Vector2<class_vector2>` offset **)**
  106. Set the offset of the GraphNode.
  107. .. _class_GraphNode_get_offset:
  108. - :ref:`Vector2<class_vector2>` **get_offset** **(** **)** const
  109. Return the offset of the GraphNode.
  110. .. _class_GraphNode_get_connection_output_count:
  111. - :ref:`int<class_int>` **get_connection_output_count** **(** **)**
  112. Return the number of enabled output slots (connections) of the GraphNode.
  113. .. _class_GraphNode_get_connection_input_count:
  114. - :ref:`int<class_int>` **get_connection_input_count** **(** **)**
  115. Return the number of enabled input slots (connections) to the GraphNode.
  116. .. _class_GraphNode_get_connection_output_pos:
  117. - :ref:`Vector2<class_vector2>` **get_connection_output_pos** **(** :ref:`int<class_int>` idx **)**
  118. Return the position of the output connection 'idx'.
  119. .. _class_GraphNode_get_connection_output_type:
  120. - :ref:`int<class_int>` **get_connection_output_type** **(** :ref:`int<class_int>` idx **)**
  121. Return the type of the output connection 'idx'.
  122. .. _class_GraphNode_get_connection_output_color:
  123. - :ref:`Color<class_color>` **get_connection_output_color** **(** :ref:`int<class_int>` idx **)**
  124. Return the color of the output connection 'idx'.
  125. .. _class_GraphNode_get_connection_input_pos:
  126. - :ref:`Vector2<class_vector2>` **get_connection_input_pos** **(** :ref:`int<class_int>` idx **)**
  127. Return the position of the input connection 'idx'.
  128. .. _class_GraphNode_get_connection_input_type:
  129. - :ref:`int<class_int>` **get_connection_input_type** **(** :ref:`int<class_int>` idx **)**
  130. Return the type of the input connection 'idx'.
  131. .. _class_GraphNode_get_connection_input_color:
  132. - :ref:`Color<class_color>` **get_connection_input_color** **(** :ref:`int<class_int>` idx **)**
  133. Return the color of the input connection 'idx'.
  134. .. _class_GraphNode_set_show_close_button:
  135. - void **set_show_close_button** **(** :ref:`bool<class_bool>` show **)**
  136. 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.
  137. .. _class_GraphNode_is_close_button_visible:
  138. - :ref:`bool<class_bool>` **is_close_button_visible** **(** **)** const
  139. Returns true if the close button is shown. False otherwise.