mirror of
https://github.com/godotengine/godot-docs-l10n.git
synced 2025-12-31 09:49:22 +03:00
863 lines
71 KiB
ReStructuredText
863 lines
71 KiB
ReStructuredText
:github_url: hide
|
||
|
||
.. _class_GraphNode:
|
||
|
||
GraphNode
|
||
=========
|
||
|
||
**实验性:** This class may be changed or removed in future versions.
|
||
|
||
**继承:** :ref:`GraphElement<class_GraphElement>` **<** :ref:`Container<class_Container>` **<** :ref:`Control<class_Control>` **<** :ref:`CanvasItem<class_CanvasItem>` **<** :ref:`Node<class_Node>` **<** :ref:`Object<class_Object>`
|
||
|
||
带有连接端口的容器,代表 :ref:`GraphEdit<class_GraphEdit>` 中的一个节点。
|
||
|
||
.. rst-class:: classref-introduction-group
|
||
|
||
描述
|
||
----
|
||
|
||
**GraphNode** 能够在 :ref:`GraphEdit<class_GraphEdit>` 图中创建节点,节点会根据其子控件定制内容。\ **GraphNode** 派生自 :ref:`Container<class_Container>`\ ,负责将其子节点放置在屏幕上。工作原理类似于 :ref:`VBoxContainer<class_VBoxContainer>`\ 。而子节点为 **GraphNode** 提供所谓的插槽,每个插槽的两侧都可以有一个连接端口。
|
||
|
||
\ **GraphNode** 的插槽由其索引定义,一个插槽可以为节点提供最多两个端口:一个在左侧,一个在右侧。根据惯例,左侧端口也被称为\ **输入端口**\ ,右侧端口被称为\ **输出端口**\ 。每个端口都可以单独启用和配置,使用不同的类型和颜色。类型是你按照自己的需要来定义的任意值。父 :ref:`GraphEdit<class_GraphEdit>` 将在每个连接和断开连接请求中收到此信息。
|
||
|
||
添加至少一个子 :ref:`Control<class_Control>` 后,就可以在“检查器”面板中配置插槽。这些属性在“Slot”部分中按每个插槽的索引进行分组。
|
||
|
||
\ **注意:**\ 虽然 GraphNode 是使用插槽和插槽索引设置的,但连接是在启用的端口之间建立的。因此 :ref:`GraphEdit<class_GraphEdit>` 使用端口的索引,而不是插槽的索引。可以使用 :ref:`get_input_port_slot()<class_GraphNode_method_get_input_port_slot>` 和 :ref:`get_output_port_slot()<class_GraphNode_method_get_output_port_slot>` 从端口索引中获取插槽索引。
|
||
|
||
.. rst-class:: classref-reftable-group
|
||
|
||
属性
|
||
----
|
||
|
||
.. table::
|
||
:widths: auto
|
||
|
||
+----------------------------------------------+------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------+
|
||
| :ref:`FocusMode<enum_Control_FocusMode>` | focus_mode | ``3`` (overrides :ref:`Control<class_Control_property_focus_mode>`) |
|
||
+----------------------------------------------+------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------+
|
||
| :ref:`bool<class_bool>` | :ref:`ignore_invalid_connection_type<class_GraphNode_property_ignore_invalid_connection_type>` | ``false`` |
|
||
+----------------------------------------------+------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------+
|
||
| :ref:`MouseFilter<enum_Control_MouseFilter>` | mouse_filter | ``0`` (overrides :ref:`Control<class_Control_property_mouse_filter>`) |
|
||
+----------------------------------------------+------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------+
|
||
| :ref:`FocusMode<enum_Control_FocusMode>` | :ref:`slots_focus_mode<class_GraphNode_property_slots_focus_mode>` | ``3`` |
|
||
+----------------------------------------------+------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------+
|
||
| :ref:`String<class_String>` | :ref:`title<class_GraphNode_property_title>` | ``""`` |
|
||
+----------------------------------------------+------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------+
|
||
|
||
.. rst-class:: classref-reftable-group
|
||
|
||
方法
|
||
----
|
||
|
||
.. table::
|
||
:widths: auto
|
||
|
||
+-------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`_draw_port<class_GraphNode_private_method__draw_port>`\ (\ slot_index\: :ref:`int<class_int>`, position\: :ref:`Vector2i<class_Vector2i>`, left\: :ref:`bool<class_bool>`, color\: :ref:`Color<class_Color>`\ ) |virtual| |
|
||
+-------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`clear_all_slots<class_GraphNode_method_clear_all_slots>`\ (\ ) |
|
||
+-------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`clear_slot<class_GraphNode_method_clear_slot>`\ (\ slot_index\: :ref:`int<class_int>`\ ) |
|
||
+-------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`Color<class_Color>` | :ref:`get_input_port_color<class_GraphNode_method_get_input_port_color>`\ (\ port_idx\: :ref:`int<class_int>`\ ) |
|
||
+-------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`int<class_int>` | :ref:`get_input_port_count<class_GraphNode_method_get_input_port_count>`\ (\ ) |
|
||
+-------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`Vector2<class_Vector2>` | :ref:`get_input_port_position<class_GraphNode_method_get_input_port_position>`\ (\ port_idx\: :ref:`int<class_int>`\ ) |
|
||
+-------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`int<class_int>` | :ref:`get_input_port_slot<class_GraphNode_method_get_input_port_slot>`\ (\ port_idx\: :ref:`int<class_int>`\ ) |
|
||
+-------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`int<class_int>` | :ref:`get_input_port_type<class_GraphNode_method_get_input_port_type>`\ (\ port_idx\: :ref:`int<class_int>`\ ) |
|
||
+-------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`Color<class_Color>` | :ref:`get_output_port_color<class_GraphNode_method_get_output_port_color>`\ (\ port_idx\: :ref:`int<class_int>`\ ) |
|
||
+-------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`int<class_int>` | :ref:`get_output_port_count<class_GraphNode_method_get_output_port_count>`\ (\ ) |
|
||
+-------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`Vector2<class_Vector2>` | :ref:`get_output_port_position<class_GraphNode_method_get_output_port_position>`\ (\ port_idx\: :ref:`int<class_int>`\ ) |
|
||
+-------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`int<class_int>` | :ref:`get_output_port_slot<class_GraphNode_method_get_output_port_slot>`\ (\ port_idx\: :ref:`int<class_int>`\ ) |
|
||
+-------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`int<class_int>` | :ref:`get_output_port_type<class_GraphNode_method_get_output_port_type>`\ (\ port_idx\: :ref:`int<class_int>`\ ) |
|
||
+-------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`Color<class_Color>` | :ref:`get_slot_color_left<class_GraphNode_method_get_slot_color_left>`\ (\ slot_index\: :ref:`int<class_int>`\ ) |const| |
|
||
+-------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`Color<class_Color>` | :ref:`get_slot_color_right<class_GraphNode_method_get_slot_color_right>`\ (\ slot_index\: :ref:`int<class_int>`\ ) |const| |
|
||
+-------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`Texture2D<class_Texture2D>` | :ref:`get_slot_custom_icon_left<class_GraphNode_method_get_slot_custom_icon_left>`\ (\ slot_index\: :ref:`int<class_int>`\ ) |const| |
|
||
+-------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`Texture2D<class_Texture2D>` | :ref:`get_slot_custom_icon_right<class_GraphNode_method_get_slot_custom_icon_right>`\ (\ slot_index\: :ref:`int<class_int>`\ ) |const| |
|
||
+-------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`Variant<class_Variant>` | :ref:`get_slot_metadata_left<class_GraphNode_method_get_slot_metadata_left>`\ (\ slot_index\: :ref:`int<class_int>`\ ) |const| |
|
||
+-------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`Variant<class_Variant>` | :ref:`get_slot_metadata_right<class_GraphNode_method_get_slot_metadata_right>`\ (\ slot_index\: :ref:`int<class_int>`\ ) |const| |
|
||
+-------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`int<class_int>` | :ref:`get_slot_type_left<class_GraphNode_method_get_slot_type_left>`\ (\ slot_index\: :ref:`int<class_int>`\ ) |const| |
|
||
+-------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`int<class_int>` | :ref:`get_slot_type_right<class_GraphNode_method_get_slot_type_right>`\ (\ slot_index\: :ref:`int<class_int>`\ ) |const| |
|
||
+-------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`HBoxContainer<class_HBoxContainer>` | :ref:`get_titlebar_hbox<class_GraphNode_method_get_titlebar_hbox>`\ (\ ) |
|
||
+-------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`bool<class_bool>` | :ref:`is_slot_draw_stylebox<class_GraphNode_method_is_slot_draw_stylebox>`\ (\ slot_index\: :ref:`int<class_int>`\ ) |const| |
|
||
+-------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`bool<class_bool>` | :ref:`is_slot_enabled_left<class_GraphNode_method_is_slot_enabled_left>`\ (\ slot_index\: :ref:`int<class_int>`\ ) |const| |
|
||
+-------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`bool<class_bool>` | :ref:`is_slot_enabled_right<class_GraphNode_method_is_slot_enabled_right>`\ (\ slot_index\: :ref:`int<class_int>`\ ) |const| |
|
||
+-------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`set_slot<class_GraphNode_method_set_slot>`\ (\ slot_index\: :ref:`int<class_int>`, enable_left_port\: :ref:`bool<class_bool>`, type_left\: :ref:`int<class_int>`, color_left\: :ref:`Color<class_Color>`, enable_right_port\: :ref:`bool<class_bool>`, type_right\: :ref:`int<class_int>`, color_right\: :ref:`Color<class_Color>`, custom_icon_left\: :ref:`Texture2D<class_Texture2D>` = null, custom_icon_right\: :ref:`Texture2D<class_Texture2D>` = null, draw_stylebox\: :ref:`bool<class_bool>` = true\ ) |
|
||
+-------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`set_slot_color_left<class_GraphNode_method_set_slot_color_left>`\ (\ slot_index\: :ref:`int<class_int>`, color\: :ref:`Color<class_Color>`\ ) |
|
||
+-------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`set_slot_color_right<class_GraphNode_method_set_slot_color_right>`\ (\ slot_index\: :ref:`int<class_int>`, color\: :ref:`Color<class_Color>`\ ) |
|
||
+-------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`set_slot_custom_icon_left<class_GraphNode_method_set_slot_custom_icon_left>`\ (\ slot_index\: :ref:`int<class_int>`, custom_icon\: :ref:`Texture2D<class_Texture2D>`\ ) |
|
||
+-------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`set_slot_custom_icon_right<class_GraphNode_method_set_slot_custom_icon_right>`\ (\ slot_index\: :ref:`int<class_int>`, custom_icon\: :ref:`Texture2D<class_Texture2D>`\ ) |
|
||
+-------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`set_slot_draw_stylebox<class_GraphNode_method_set_slot_draw_stylebox>`\ (\ slot_index\: :ref:`int<class_int>`, enable\: :ref:`bool<class_bool>`\ ) |
|
||
+-------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`set_slot_enabled_left<class_GraphNode_method_set_slot_enabled_left>`\ (\ slot_index\: :ref:`int<class_int>`, enable\: :ref:`bool<class_bool>`\ ) |
|
||
+-------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`set_slot_enabled_right<class_GraphNode_method_set_slot_enabled_right>`\ (\ slot_index\: :ref:`int<class_int>`, enable\: :ref:`bool<class_bool>`\ ) |
|
||
+-------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`set_slot_metadata_left<class_GraphNode_method_set_slot_metadata_left>`\ (\ slot_index\: :ref:`int<class_int>`, value\: :ref:`Variant<class_Variant>`\ ) |
|
||
+-------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`set_slot_metadata_right<class_GraphNode_method_set_slot_metadata_right>`\ (\ slot_index\: :ref:`int<class_int>`, value\: :ref:`Variant<class_Variant>`\ ) |
|
||
+-------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`set_slot_type_left<class_GraphNode_method_set_slot_type_left>`\ (\ slot_index\: :ref:`int<class_int>`, type\: :ref:`int<class_int>`\ ) |
|
||
+-------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`set_slot_type_right<class_GraphNode_method_set_slot_type_right>`\ (\ slot_index\: :ref:`int<class_int>`, type\: :ref:`int<class_int>`\ ) |
|
||
+-------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
|
||
.. rst-class:: classref-reftable-group
|
||
|
||
主题属性
|
||
--------
|
||
|
||
.. table::
|
||
:widths: auto
|
||
|
||
+-----------------------------------+-------------------------------------------------------------------------+-----------------------------------+
|
||
| :ref:`Color<class_Color>` | :ref:`resizer_color<class_GraphNode_theme_color_resizer_color>` | ``Color(0.875, 0.875, 0.875, 1)`` |
|
||
+-----------------------------------+-------------------------------------------------------------------------+-----------------------------------+
|
||
| :ref:`int<class_int>` | :ref:`port_h_offset<class_GraphNode_theme_constant_port_h_offset>` | ``0`` |
|
||
+-----------------------------------+-------------------------------------------------------------------------+-----------------------------------+
|
||
| :ref:`int<class_int>` | :ref:`separation<class_GraphNode_theme_constant_separation>` | ``2`` |
|
||
+-----------------------------------+-------------------------------------------------------------------------+-----------------------------------+
|
||
| :ref:`Texture2D<class_Texture2D>` | :ref:`port<class_GraphNode_theme_icon_port>` | |
|
||
+-----------------------------------+-------------------------------------------------------------------------+-----------------------------------+
|
||
| :ref:`StyleBox<class_StyleBox>` | :ref:`panel<class_GraphNode_theme_style_panel>` | |
|
||
+-----------------------------------+-------------------------------------------------------------------------+-----------------------------------+
|
||
| :ref:`StyleBox<class_StyleBox>` | :ref:`panel_focus<class_GraphNode_theme_style_panel_focus>` | |
|
||
+-----------------------------------+-------------------------------------------------------------------------+-----------------------------------+
|
||
| :ref:`StyleBox<class_StyleBox>` | :ref:`panel_selected<class_GraphNode_theme_style_panel_selected>` | |
|
||
+-----------------------------------+-------------------------------------------------------------------------+-----------------------------------+
|
||
| :ref:`StyleBox<class_StyleBox>` | :ref:`slot<class_GraphNode_theme_style_slot>` | |
|
||
+-----------------------------------+-------------------------------------------------------------------------+-----------------------------------+
|
||
| :ref:`StyleBox<class_StyleBox>` | :ref:`slot_selected<class_GraphNode_theme_style_slot_selected>` | |
|
||
+-----------------------------------+-------------------------------------------------------------------------+-----------------------------------+
|
||
| :ref:`StyleBox<class_StyleBox>` | :ref:`titlebar<class_GraphNode_theme_style_titlebar>` | |
|
||
+-----------------------------------+-------------------------------------------------------------------------+-----------------------------------+
|
||
| :ref:`StyleBox<class_StyleBox>` | :ref:`titlebar_selected<class_GraphNode_theme_style_titlebar_selected>` | |
|
||
+-----------------------------------+-------------------------------------------------------------------------+-----------------------------------+
|
||
|
||
.. rst-class:: classref-section-separator
|
||
|
||
----
|
||
|
||
.. rst-class:: classref-descriptions-group
|
||
|
||
信号
|
||
----
|
||
|
||
.. _class_GraphNode_signal_slot_sizes_changed:
|
||
|
||
.. rst-class:: classref-signal
|
||
|
||
**slot_sizes_changed**\ (\ ) :ref:`🔗<class_GraphNode_signal_slot_sizes_changed>`
|
||
|
||
当任意插槽的大小可能已更改时发出。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_GraphNode_signal_slot_updated:
|
||
|
||
.. rst-class:: classref-signal
|
||
|
||
**slot_updated**\ (\ slot_index\: :ref:`int<class_int>`\ ) :ref:`🔗<class_GraphNode_signal_slot_updated>`
|
||
|
||
当任意图形节点的插槽更新时发出。
|
||
|
||
.. rst-class:: classref-section-separator
|
||
|
||
----
|
||
|
||
.. rst-class:: classref-descriptions-group
|
||
|
||
属性说明
|
||
--------
|
||
|
||
.. _class_GraphNode_property_ignore_invalid_connection_type:
|
||
|
||
.. rst-class:: classref-property
|
||
|
||
:ref:`bool<class_bool>` **ignore_invalid_connection_type** = ``false`` :ref:`🔗<class_GraphNode_property_ignore_invalid_connection_type>`
|
||
|
||
.. rst-class:: classref-property-setget
|
||
|
||
- |void| **set_ignore_invalid_connection_type**\ (\ value\: :ref:`bool<class_bool>`\ )
|
||
- :ref:`bool<class_bool>` **is_ignoring_valid_connection_type**\ (\ )
|
||
|
||
如果为 ``true``\ ,则可以连接不同类型的端口,即使父级 :ref:`GraphEdit<class_GraphEdit>` 中未明确允许该连接。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_GraphNode_property_slots_focus_mode:
|
||
|
||
.. rst-class:: classref-property
|
||
|
||
:ref:`FocusMode<enum_Control_FocusMode>` **slots_focus_mode** = ``3`` :ref:`🔗<class_GraphNode_property_slots_focus_mode>`
|
||
|
||
.. rst-class:: classref-property-setget
|
||
|
||
- |void| **set_slots_focus_mode**\ (\ value\: :ref:`FocusMode<enum_Control_FocusMode>`\ )
|
||
- :ref:`FocusMode<enum_Control_FocusMode>` **get_slots_focus_mode**\ (\ )
|
||
|
||
决定连接槽位的聚焦方法。
|
||
|
||
- 如果设为 :ref:`Control.FOCUS_CLICK<class_Control_constant_FOCUS_CLICK>`\ ,则只能使用鼠标创建连接。
|
||
|
||
- 如果设为 :ref:`Control.FOCUS_ALL<class_Control_constant_FOCUS_ALL>`\ ,则槽位还可以使用 :ref:`ProjectSettings.input/ui_up<class_ProjectSettings_property_input/ui_up>` 和 :ref:`ProjectSettings.input/ui_down<class_ProjectSettings_property_input/ui_down>` 聚焦,使用 :ref:`ProjectSettings.input/ui_left<class_ProjectSettings_property_input/ui_left>` 和 :ref:`ProjectSettings.input/ui_right<class_ProjectSettings_property_input/ui_right>` 输入动作连接。
|
||
|
||
- 如果设为 :ref:`Control.FOCUS_ACCESSIBILITY<class_Control_constant_FOCUS_ACCESSIBILITY>`\ ,则只会在读屏软件活动时启用槽位输入动作。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_GraphNode_property_title:
|
||
|
||
.. rst-class:: classref-property
|
||
|
||
:ref:`String<class_String>` **title** = ``""`` :ref:`🔗<class_GraphNode_property_title>`
|
||
|
||
.. rst-class:: classref-property-setget
|
||
|
||
- |void| **set_title**\ (\ value\: :ref:`String<class_String>`\ )
|
||
- :ref:`String<class_String>` **get_title**\ (\ )
|
||
|
||
显示在 GraphNode 标题栏中的文本。
|
||
|
||
.. rst-class:: classref-section-separator
|
||
|
||
----
|
||
|
||
.. rst-class:: classref-descriptions-group
|
||
|
||
方法说明
|
||
--------
|
||
|
||
.. _class_GraphNode_private_method__draw_port:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **_draw_port**\ (\ slot_index\: :ref:`int<class_int>`, position\: :ref:`Vector2i<class_Vector2i>`, left\: :ref:`bool<class_bool>`, color\: :ref:`Color<class_Color>`\ ) |virtual| :ref:`🔗<class_GraphNode_private_method__draw_port>`
|
||
|
||
.. container:: contribute
|
||
|
||
There is currently no description for this method. Please help us by `contributing one <https://contributing.godotengine.org/en/latest/documentation/class_reference.html>`__!
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_GraphNode_method_clear_all_slots:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **clear_all_slots**\ (\ ) :ref:`🔗<class_GraphNode_method_clear_all_slots>`
|
||
|
||
禁用 GraphNode 的所有插槽。会移除该 GraphNode 的所有输入/输出端口。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_GraphNode_method_clear_slot:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **clear_slot**\ (\ slot_index\: :ref:`int<class_int>`\ ) :ref:`🔗<class_GraphNode_method_clear_slot>`
|
||
|
||
禁用索引为 ``slot_index`` 的插槽。会移除该 GraphNode 的对应输入和输出端口。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_GraphNode_method_get_input_port_color:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`Color<class_Color>` **get_input_port_color**\ (\ port_idx\: :ref:`int<class_int>`\ ) :ref:`🔗<class_GraphNode_method_get_input_port_color>`
|
||
|
||
返回索引为 ``port_idx`` 的输入端口的 :ref:`Color<class_Color>`\ 。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_GraphNode_method_get_input_port_count:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`int<class_int>` **get_input_port_count**\ (\ ) :ref:`🔗<class_GraphNode_method_get_input_port_count>`
|
||
|
||
返回启用了输入端口的插槽数。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_GraphNode_method_get_input_port_position:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`Vector2<class_Vector2>` **get_input_port_position**\ (\ port_idx\: :ref:`int<class_int>`\ ) :ref:`🔗<class_GraphNode_method_get_input_port_position>`
|
||
|
||
返回索引为 ``port_idx`` 的输入端口的位置。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_GraphNode_method_get_input_port_slot:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`int<class_int>` **get_input_port_slot**\ (\ port_idx\: :ref:`int<class_int>`\ ) :ref:`🔗<class_GraphNode_method_get_input_port_slot>`
|
||
|
||
返回索引为 ``port_idx`` 的输入端口的对应插槽索引。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_GraphNode_method_get_input_port_type:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`int<class_int>` **get_input_port_type**\ (\ port_idx\: :ref:`int<class_int>`\ ) :ref:`🔗<class_GraphNode_method_get_input_port_type>`
|
||
|
||
返回索引为 ``port_idx`` 的输入端口的类型。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_GraphNode_method_get_output_port_color:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`Color<class_Color>` **get_output_port_color**\ (\ port_idx\: :ref:`int<class_int>`\ ) :ref:`🔗<class_GraphNode_method_get_output_port_color>`
|
||
|
||
返回索引为 ``port_idx`` 的输出端口的 :ref:`Color<class_Color>`\ 。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_GraphNode_method_get_output_port_count:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`int<class_int>` **get_output_port_count**\ (\ ) :ref:`🔗<class_GraphNode_method_get_output_port_count>`
|
||
|
||
返回启用了输出端口的插槽数。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_GraphNode_method_get_output_port_position:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`Vector2<class_Vector2>` **get_output_port_position**\ (\ port_idx\: :ref:`int<class_int>`\ ) :ref:`🔗<class_GraphNode_method_get_output_port_position>`
|
||
|
||
返回索引为 ``port_idx`` 的输出端口的位置。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_GraphNode_method_get_output_port_slot:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`int<class_int>` **get_output_port_slot**\ (\ port_idx\: :ref:`int<class_int>`\ ) :ref:`🔗<class_GraphNode_method_get_output_port_slot>`
|
||
|
||
返回索引为 ``port_idx`` 的输出端口的对应插槽索引。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_GraphNode_method_get_output_port_type:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`int<class_int>` **get_output_port_type**\ (\ port_idx\: :ref:`int<class_int>`\ ) :ref:`🔗<class_GraphNode_method_get_output_port_type>`
|
||
|
||
返回索引为 ``port_idx`` 的输出端口的类型。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_GraphNode_method_get_slot_color_left:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`Color<class_Color>` **get_slot_color_left**\ (\ slot_index\: :ref:`int<class_int>`\ ) |const| :ref:`🔗<class_GraphNode_method_get_slot_color_left>`
|
||
|
||
返回索引为 ``slot_index`` 的插槽左侧(输入)的 :ref:`Color<class_Color>`\ 。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_GraphNode_method_get_slot_color_right:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`Color<class_Color>` **get_slot_color_right**\ (\ slot_index\: :ref:`int<class_int>`\ ) |const| :ref:`🔗<class_GraphNode_method_get_slot_color_right>`
|
||
|
||
返回索引为 ``slot_index`` 的插槽右侧(输出)的 :ref:`Color<class_Color>`\ 。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_GraphNode_method_get_slot_custom_icon_left:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`Texture2D<class_Texture2D>` **get_slot_custom_icon_left**\ (\ slot_index\: :ref:`int<class_int>`\ ) |const| :ref:`🔗<class_GraphNode_method_get_slot_custom_icon_left>`
|
||
|
||
返回具有给定 ``slot_index`` 的插槽的左侧(输入)的自定义 :ref:`Texture2D<class_Texture2D>`\ 。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_GraphNode_method_get_slot_custom_icon_right:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`Texture2D<class_Texture2D>` **get_slot_custom_icon_right**\ (\ slot_index\: :ref:`int<class_int>`\ ) |const| :ref:`🔗<class_GraphNode_method_get_slot_custom_icon_right>`
|
||
|
||
返回具有给定 ``slot_index`` 的插槽的右侧(输出)的自定义 :ref:`Texture2D<class_Texture2D>`\ 。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_GraphNode_method_get_slot_metadata_left:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`Variant<class_Variant>` **get_slot_metadata_left**\ (\ slot_index\: :ref:`int<class_int>`\ ) |const| :ref:`🔗<class_GraphNode_method_get_slot_metadata_left>`
|
||
|
||
Returns the left (input) metadata of the slot with the given ``slot_index``.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_GraphNode_method_get_slot_metadata_right:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`Variant<class_Variant>` **get_slot_metadata_right**\ (\ slot_index\: :ref:`int<class_int>`\ ) |const| :ref:`🔗<class_GraphNode_method_get_slot_metadata_right>`
|
||
|
||
Returns the right (output) metadata of the slot with the given ``slot_index``.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_GraphNode_method_get_slot_type_left:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`int<class_int>` **get_slot_type_left**\ (\ slot_index\: :ref:`int<class_int>`\ ) |const| :ref:`🔗<class_GraphNode_method_get_slot_type_left>`
|
||
|
||
返回索引为 ``slot_index`` 的插槽左侧(输入)的类型。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_GraphNode_method_get_slot_type_right:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`int<class_int>` **get_slot_type_right**\ (\ slot_index\: :ref:`int<class_int>`\ ) |const| :ref:`🔗<class_GraphNode_method_get_slot_type_right>`
|
||
|
||
返回索引为 ``slot_index`` 的插槽右侧(输出)的类型。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_GraphNode_method_get_titlebar_hbox:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`HBoxContainer<class_HBoxContainer>` **get_titlebar_hbox**\ (\ ) :ref:`🔗<class_GraphNode_method_get_titlebar_hbox>`
|
||
|
||
返回标题栏所使用的 :ref:`HBoxContainer<class_HBoxContainer>`\ ,默认只包含一个 :ref:`Label<class_Label>`\ ,用于显示标题。可用于向标题栏添加自定义控件,例如选项和关闭按钮等。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_GraphNode_method_is_slot_draw_stylebox:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`bool<class_bool>` **is_slot_draw_stylebox**\ (\ slot_index\: :ref:`int<class_int>`\ ) |const| :ref:`🔗<class_GraphNode_method_is_slot_draw_stylebox>`
|
||
|
||
如果绘制索引为 ``slot_index`` 的槽位的背景 :ref:`StyleBox<class_StyleBox>`\ ,则返回 ``true``\ 。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_GraphNode_method_is_slot_enabled_left:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`bool<class_bool>` **is_slot_enabled_left**\ (\ slot_index\: :ref:`int<class_int>`\ ) |const| :ref:`🔗<class_GraphNode_method_is_slot_enabled_left>`
|
||
|
||
如果启用了索引为 ``slot_index`` 的插槽的左侧(输入),则返回 ``true``\ 。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_GraphNode_method_is_slot_enabled_right:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`bool<class_bool>` **is_slot_enabled_right**\ (\ slot_index\: :ref:`int<class_int>`\ ) |const| :ref:`🔗<class_GraphNode_method_is_slot_enabled_right>`
|
||
|
||
如果启用了索引为 ``slot_index`` 的插槽的右侧(输出),则返回 ``true``\ 。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_GraphNode_method_set_slot:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **set_slot**\ (\ slot_index\: :ref:`int<class_int>`, enable_left_port\: :ref:`bool<class_bool>`, type_left\: :ref:`int<class_int>`, color_left\: :ref:`Color<class_Color>`, enable_right_port\: :ref:`bool<class_bool>`, type_right\: :ref:`int<class_int>`, color_right\: :ref:`Color<class_Color>`, custom_icon_left\: :ref:`Texture2D<class_Texture2D>` = null, custom_icon_right\: :ref:`Texture2D<class_Texture2D>` = null, draw_stylebox\: :ref:`bool<class_bool>` = true\ ) :ref:`🔗<class_GraphNode_method_set_slot>`
|
||
|
||
设置索引为 ``slot_index`` 的插槽的属性。
|
||
|
||
如果 ``enable_left_port``/``enable_right_port`` 为 ``true``\ ,则将出现一个端口,插槽将能够从这一侧连接。
|
||
|
||
使用 ``type_left``/``type_right`` 可以为每个端口分配一个任意类型。如果两个端口具有相同的类型,或者如果它们的类型之间的连接在父 :ref:`GraphEdit<class_GraphEdit>` 中被允许(参见 :ref:`GraphEdit.add_valid_connection_type()<class_GraphEdit_method_add_valid_connection_type>`\ ),那么这两个端口就可以被连接。请记住,\ :ref:`GraphEdit<class_GraphEdit>` 在接受连接上拥有最终决定权。类型兼容性只允许发出 :ref:`GraphEdit.connection_request<class_GraphEdit_signal_connection_request>` 信号。
|
||
|
||
可以使用 ``color_left``/``color_right`` 和 ``custom_icon_left``/``custom_icon_right`` 进一步定制端口。颜色参数为图标添加了一个色调。自定义图标可以用来覆盖默认的端口点。
|
||
|
||
此外,\ ``draw_stylebox`` 可以用来启用或禁用每个插槽的背景样式框的绘制。参见 :ref:`slot<class_GraphNode_theme_style_slot>`\ 。
|
||
|
||
单个属性也可以使用 ``set_slot_*`` 方法之一来设置。
|
||
|
||
\ **注意:**\ 该方法只设置插槽的属性。要创建插槽本身,请将 :ref:`Control<class_Control>` 派生的子节点添加到该 GraphNode。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_GraphNode_method_set_slot_color_left:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **set_slot_color_left**\ (\ slot_index\: :ref:`int<class_int>`, color\: :ref:`Color<class_Color>`\ ) :ref:`🔗<class_GraphNode_method_set_slot_color_left>`
|
||
|
||
将索引为 ``slot_index`` 的插槽的左侧(输入)的 :ref:`Color<class_Color>` 设置为 ``color``\ 。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_GraphNode_method_set_slot_color_right:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **set_slot_color_right**\ (\ slot_index\: :ref:`int<class_int>`, color\: :ref:`Color<class_Color>`\ ) :ref:`🔗<class_GraphNode_method_set_slot_color_right>`
|
||
|
||
将索引为 ``slot_index`` 的插槽的右侧(输出)的 :ref:`Color<class_Color>` 设置为 ``color``\ 。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_GraphNode_method_set_slot_custom_icon_left:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **set_slot_custom_icon_left**\ (\ slot_index\: :ref:`int<class_int>`, custom_icon\: :ref:`Texture2D<class_Texture2D>`\ ) :ref:`🔗<class_GraphNode_method_set_slot_custom_icon_left>`
|
||
|
||
将索引为 ``slot_index`` 的插槽的左侧(输入)的自定义 :ref:`Texture2D<class_Texture2D>` 设置为 ``custom_icon``\ 。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_GraphNode_method_set_slot_custom_icon_right:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **set_slot_custom_icon_right**\ (\ slot_index\: :ref:`int<class_int>`, custom_icon\: :ref:`Texture2D<class_Texture2D>`\ ) :ref:`🔗<class_GraphNode_method_set_slot_custom_icon_right>`
|
||
|
||
将索引为 ``slot_index`` 的插槽的右侧(输出)的自定义 :ref:`Texture2D<class_Texture2D>` 设置为 ``custom_icon``\ 。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_GraphNode_method_set_slot_draw_stylebox:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **set_slot_draw_stylebox**\ (\ slot_index\: :ref:`int<class_int>`, enable\: :ref:`bool<class_bool>`\ ) :ref:`🔗<class_GraphNode_method_set_slot_draw_stylebox>`
|
||
|
||
开关索引为 ``slot_index`` 的插槽的背景 :ref:`StyleBox<class_StyleBox>`\ 。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_GraphNode_method_set_slot_enabled_left:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **set_slot_enabled_left**\ (\ slot_index\: :ref:`int<class_int>`, enable\: :ref:`bool<class_bool>`\ ) :ref:`🔗<class_GraphNode_method_set_slot_enabled_left>`
|
||
|
||
切换给定插槽 ``slot_index`` 的左侧(输入)端口。如果 ``enable`` 为 ``true``\ ,则左侧会出现一个端口,并且该插槽可以从这一侧连接。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_GraphNode_method_set_slot_enabled_right:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **set_slot_enabled_right**\ (\ slot_index\: :ref:`int<class_int>`, enable\: :ref:`bool<class_bool>`\ ) :ref:`🔗<class_GraphNode_method_set_slot_enabled_right>`
|
||
|
||
切换给定插槽 ``slot_index`` 的右侧(输出)端口。如果 ``enable`` 为 ``true``\ ,则右侧会出现一个端口,并且该插槽可以从这一侧连接。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_GraphNode_method_set_slot_metadata_left:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **set_slot_metadata_left**\ (\ slot_index\: :ref:`int<class_int>`, value\: :ref:`Variant<class_Variant>`\ ) :ref:`🔗<class_GraphNode_method_set_slot_metadata_left>`
|
||
|
||
Sets the custom metadata for the left (input) side of the slot with the given ``slot_index`` to ``value``.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_GraphNode_method_set_slot_metadata_right:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **set_slot_metadata_right**\ (\ slot_index\: :ref:`int<class_int>`, value\: :ref:`Variant<class_Variant>`\ ) :ref:`🔗<class_GraphNode_method_set_slot_metadata_right>`
|
||
|
||
Sets the custom metadata for the right (output) side of the slot with the given ``slot_index`` to ``value``.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_GraphNode_method_set_slot_type_left:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **set_slot_type_left**\ (\ slot_index\: :ref:`int<class_int>`, type\: :ref:`int<class_int>`\ ) :ref:`🔗<class_GraphNode_method_set_slot_type_left>`
|
||
|
||
将给定插槽 ``slot_index`` 的左侧(输入)类型设置为 ``type``\ 。如果该值为负,则所有的连接将不允许通过用户输入来创建。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_GraphNode_method_set_slot_type_right:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **set_slot_type_right**\ (\ slot_index\: :ref:`int<class_int>`, type\: :ref:`int<class_int>`\ ) :ref:`🔗<class_GraphNode_method_set_slot_type_right>`
|
||
|
||
将给定插槽 ``slot_index`` 的右侧(输出)类型设置为 ``type``\ 。如果该值为负,则所有的连接将不允许通过用户输入来创建。
|
||
|
||
.. rst-class:: classref-section-separator
|
||
|
||
----
|
||
|
||
.. rst-class:: classref-descriptions-group
|
||
|
||
主题属性说明
|
||
------------
|
||
|
||
.. _class_GraphNode_theme_color_resizer_color:
|
||
|
||
.. rst-class:: classref-themeproperty
|
||
|
||
:ref:`Color<class_Color>` **resizer_color** = ``Color(0.875, 0.875, 0.875, 1)`` :ref:`🔗<class_GraphNode_theme_color_resizer_color>`
|
||
|
||
应用于调整尺寸大小图标的颜色调制。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_GraphNode_theme_constant_port_h_offset:
|
||
|
||
.. rst-class:: classref-themeproperty
|
||
|
||
:ref:`int<class_int>` **port_h_offset** = ``0`` :ref:`🔗<class_GraphNode_theme_constant_port_h_offset>`
|
||
|
||
端口的水平偏移量。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_GraphNode_theme_constant_separation:
|
||
|
||
.. rst-class:: classref-themeproperty
|
||
|
||
:ref:`int<class_int>` **separation** = ``2`` :ref:`🔗<class_GraphNode_theme_constant_separation>`
|
||
|
||
端口之间的垂直距离。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_GraphNode_theme_icon_port:
|
||
|
||
.. rst-class:: classref-themeproperty
|
||
|
||
:ref:`Texture2D<class_Texture2D>` **port** :ref:`🔗<class_GraphNode_theme_icon_port>`
|
||
|
||
该图标用于表示端口。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_GraphNode_theme_style_panel:
|
||
|
||
.. rst-class:: classref-themeproperty
|
||
|
||
:ref:`StyleBox<class_StyleBox>` **panel** :ref:`🔗<class_GraphNode_theme_style_panel>`
|
||
|
||
**GraphNode** 槽区域的默认背景。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_GraphNode_theme_style_panel_focus:
|
||
|
||
.. rst-class:: classref-themeproperty
|
||
|
||
:ref:`StyleBox<class_StyleBox>` **panel_focus** :ref:`🔗<class_GraphNode_theme_style_panel_focus>`
|
||
|
||
当 **GraphNode** 处于聚焦状态时使用的 :ref:`StyleBox<class_StyleBox>`\ (使用辅助应用时)。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_GraphNode_theme_style_panel_selected:
|
||
|
||
.. rst-class:: classref-themeproperty
|
||
|
||
:ref:`StyleBox<class_StyleBox>` **panel_selected** :ref:`🔗<class_GraphNode_theme_style_panel_selected>`
|
||
|
||
用于被选中时的插槽区域的 :ref:`StyleBox<class_StyleBox>`\ 。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_GraphNode_theme_style_slot:
|
||
|
||
.. rst-class:: classref-themeproperty
|
||
|
||
:ref:`StyleBox<class_StyleBox>` **slot** :ref:`🔗<class_GraphNode_theme_style_slot>`
|
||
|
||
用于 **GraphNode** 的每个插槽的 :ref:`StyleBox<class_StyleBox>`\ 。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_GraphNode_theme_style_slot_selected:
|
||
|
||
.. rst-class:: classref-themeproperty
|
||
|
||
:ref:`StyleBox<class_StyleBox>` **slot_selected** :ref:`🔗<class_GraphNode_theme_style_slot_selected>`
|
||
|
||
当插槽处于聚焦状态时使用的 :ref:`StyleBox<class_StyleBox>`\ (使用辅助应用时)。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_GraphNode_theme_style_titlebar:
|
||
|
||
.. rst-class:: classref-themeproperty
|
||
|
||
:ref:`StyleBox<class_StyleBox>` **titlebar** :ref:`🔗<class_GraphNode_theme_style_titlebar>`
|
||
|
||
用于该 **GraphNode** 标题栏的 :ref:`StyleBox<class_StyleBox>`\ 。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_GraphNode_theme_style_titlebar_selected:
|
||
|
||
.. rst-class:: classref-themeproperty
|
||
|
||
:ref:`StyleBox<class_StyleBox>` **titlebar_selected** :ref:`🔗<class_GraphNode_theme_style_titlebar_selected>`
|
||
|
||
当 **GraphNode** 被选中时,用于其标题栏的 :ref:`StyleBox<class_StyleBox>`\ 。
|
||
|
||
.. |virtual| replace:: :abbr:`virtual (本方法通常需要用户覆盖才能生效。)`
|
||
.. |required| replace:: :abbr:`required (This method is required to be overridden when extending its base class.)`
|
||
.. |const| replace:: :abbr:`const (本方法无副作用,不会修改该实例的任何成员变量。)`
|
||
.. |vararg| replace:: :abbr:`vararg (本方法除了能接受在此处描述的参数外,还能够继续接受任意数量的参数。)`
|
||
.. |constructor| replace:: :abbr:`constructor (本方法用于构造某个类型。)`
|
||
.. |static| replace:: :abbr:`static (调用本方法无需实例,可直接使用类名进行调用。)`
|
||
.. |operator| replace:: :abbr:`operator (本方法描述的是使用本类型作为左操作数的有效运算符。)`
|
||
.. |bitfield| replace:: :abbr:`BitField (这个值是由下列位标志构成位掩码的整数。)`
|
||
.. |void| replace:: :abbr:`void (无返回值。)`
|