mirror of
https://github.com/godotengine/godot-docs.git
synced 2026-01-04 14:11:02 +03:00
263 lines
8.1 KiB
ReStructuredText
263 lines
8.1 KiB
ReStructuredText
:github_url: hide
|
|
|
|
.. DO NOT EDIT THIS FILE!!!
|
|
.. Generated automatically from Godot engine sources.
|
|
.. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
|
|
.. XML source: https://github.com/godotengine/godot/tree/master/doc/classes/GraphElement.xml.
|
|
|
|
.. _class_GraphElement:
|
|
|
|
GraphElement
|
|
============
|
|
|
|
**Inherits:** :ref:`Container<class_Container>` **<** :ref:`Control<class_Control>` **<** :ref:`CanvasItem<class_CanvasItem>` **<** :ref:`Node<class_Node>` **<** :ref:`Object<class_Object>`
|
|
|
|
**Inherited By:** :ref:`GraphNode<class_GraphNode>`
|
|
|
|
A container that represents a basic element that can be placed inside a :ref:`GraphEdit<class_GraphEdit>` control.
|
|
|
|
.. rst-class:: classref-introduction-group
|
|
|
|
Description
|
|
-----------
|
|
|
|
**GraphElement** allows to create custom elements for a :ref:`GraphEdit<class_GraphEdit>` graph. By default such elements can be selected, resized, and repositioned, but they cannot be connected. For a graph element that allows for connections see :ref:`GraphNode<class_GraphNode>`.
|
|
|
|
.. rst-class:: classref-reftable-group
|
|
|
|
Properties
|
|
----------
|
|
|
|
.. table::
|
|
:widths: auto
|
|
|
|
+-------------------------------+---------------------------------------------------------------------+-------------------+
|
|
| :ref:`bool<class_bool>` | :ref:`draggable<class_GraphElement_property_draggable>` | ``true`` |
|
|
+-------------------------------+---------------------------------------------------------------------+-------------------+
|
|
| :ref:`Vector2<class_Vector2>` | :ref:`position_offset<class_GraphElement_property_position_offset>` | ``Vector2(0, 0)`` |
|
|
+-------------------------------+---------------------------------------------------------------------+-------------------+
|
|
| :ref:`bool<class_bool>` | :ref:`resizable<class_GraphElement_property_resizable>` | ``false`` |
|
|
+-------------------------------+---------------------------------------------------------------------+-------------------+
|
|
| :ref:`bool<class_bool>` | :ref:`selectable<class_GraphElement_property_selectable>` | ``true`` |
|
|
+-------------------------------+---------------------------------------------------------------------+-------------------+
|
|
| :ref:`bool<class_bool>` | :ref:`selected<class_GraphElement_property_selected>` | ``false`` |
|
|
+-------------------------------+---------------------------------------------------------------------+-------------------+
|
|
|
|
.. rst-class:: classref-reftable-group
|
|
|
|
Theme Properties
|
|
----------------
|
|
|
|
.. table::
|
|
:widths: auto
|
|
|
|
+-----------------------------------+-------------------------------------------------------+
|
|
| :ref:`Texture2D<class_Texture2D>` | :ref:`resizer<class_GraphElement_theme_icon_resizer>` |
|
|
+-----------------------------------+-------------------------------------------------------+
|
|
|
|
.. rst-class:: classref-section-separator
|
|
|
|
----
|
|
|
|
.. rst-class:: classref-descriptions-group
|
|
|
|
Signals
|
|
-------
|
|
|
|
.. _class_GraphElement_signal_close_request:
|
|
|
|
.. rst-class:: classref-signal
|
|
|
|
**close_request** **(** **)**
|
|
|
|
Emitted when closing the GraphElement is requested.
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _class_GraphElement_signal_dragged:
|
|
|
|
.. rst-class:: classref-signal
|
|
|
|
**dragged** **(** :ref:`Vector2<class_Vector2>` from, :ref:`Vector2<class_Vector2>` to **)**
|
|
|
|
Emitted when the GraphElement is dragged.
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _class_GraphElement_signal_node_deselected:
|
|
|
|
.. rst-class:: classref-signal
|
|
|
|
**node_deselected** **(** **)**
|
|
|
|
Emitted when the GraphElement is deselected.
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _class_GraphElement_signal_node_selected:
|
|
|
|
.. rst-class:: classref-signal
|
|
|
|
**node_selected** **(** **)**
|
|
|
|
Emitted when the GraphElement is selected.
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _class_GraphElement_signal_position_offset_changed:
|
|
|
|
.. rst-class:: classref-signal
|
|
|
|
**position_offset_changed** **(** **)**
|
|
|
|
Emitted when the GraphElement is moved.
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _class_GraphElement_signal_raise_request:
|
|
|
|
.. rst-class:: classref-signal
|
|
|
|
**raise_request** **(** **)**
|
|
|
|
Emitted when displaying the GraphElement over other ones is requested. Happens on focusing (clicking into) the GraphElement.
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _class_GraphElement_signal_resize_request:
|
|
|
|
.. rst-class:: classref-signal
|
|
|
|
**resize_request** **(** :ref:`Vector2<class_Vector2>` new_minsize **)**
|
|
|
|
Emitted when resizing the GraphElement is requested. Happens on dragging the resizer handle (see :ref:`resizable<class_GraphElement_property_resizable>`).
|
|
|
|
.. rst-class:: classref-section-separator
|
|
|
|
----
|
|
|
|
.. rst-class:: classref-descriptions-group
|
|
|
|
Property Descriptions
|
|
---------------------
|
|
|
|
.. _class_GraphElement_property_draggable:
|
|
|
|
.. rst-class:: classref-property
|
|
|
|
:ref:`bool<class_bool>` **draggable** = ``true``
|
|
|
|
.. rst-class:: classref-property-setget
|
|
|
|
- void **set_draggable** **(** :ref:`bool<class_bool>` value **)**
|
|
- :ref:`bool<class_bool>` **is_draggable** **(** **)**
|
|
|
|
If ``true``, the user can drag the GraphElement.
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _class_GraphElement_property_position_offset:
|
|
|
|
.. rst-class:: classref-property
|
|
|
|
:ref:`Vector2<class_Vector2>` **position_offset** = ``Vector2(0, 0)``
|
|
|
|
.. rst-class:: classref-property-setget
|
|
|
|
- void **set_position_offset** **(** :ref:`Vector2<class_Vector2>` value **)**
|
|
- :ref:`Vector2<class_Vector2>` **get_position_offset** **(** **)**
|
|
|
|
The offset of the GraphElement, relative to the scroll offset of the :ref:`GraphEdit<class_GraphEdit>`.
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _class_GraphElement_property_resizable:
|
|
|
|
.. rst-class:: classref-property
|
|
|
|
:ref:`bool<class_bool>` **resizable** = ``false``
|
|
|
|
.. rst-class:: classref-property-setget
|
|
|
|
- void **set_resizable** **(** :ref:`bool<class_bool>` value **)**
|
|
- :ref:`bool<class_bool>` **is_resizable** **(** **)**
|
|
|
|
If ``true``, the user can resize the GraphElement.
|
|
|
|
\ **Note:** Dragging the handle will only emit the :ref:`resize_request<class_GraphElement_signal_resize_request>` signal, the GraphElement needs to be resized manually.
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _class_GraphElement_property_selectable:
|
|
|
|
.. rst-class:: classref-property
|
|
|
|
:ref:`bool<class_bool>` **selectable** = ``true``
|
|
|
|
.. rst-class:: classref-property-setget
|
|
|
|
- void **set_selectable** **(** :ref:`bool<class_bool>` value **)**
|
|
- :ref:`bool<class_bool>` **is_selectable** **(** **)**
|
|
|
|
If ``true``, the user can select the GraphElement.
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _class_GraphElement_property_selected:
|
|
|
|
.. rst-class:: classref-property
|
|
|
|
:ref:`bool<class_bool>` **selected** = ``false``
|
|
|
|
.. rst-class:: classref-property-setget
|
|
|
|
- void **set_selected** **(** :ref:`bool<class_bool>` value **)**
|
|
- :ref:`bool<class_bool>` **is_selected** **(** **)**
|
|
|
|
If ``true``, the GraphElement is selected.
|
|
|
|
.. rst-class:: classref-section-separator
|
|
|
|
----
|
|
|
|
.. rst-class:: classref-descriptions-group
|
|
|
|
Theme Property Descriptions
|
|
---------------------------
|
|
|
|
.. _class_GraphElement_theme_icon_resizer:
|
|
|
|
.. rst-class:: classref-themeproperty
|
|
|
|
:ref:`Texture2D<class_Texture2D>` **resizer**
|
|
|
|
The icon used for the resizer, visible when :ref:`resizable<class_GraphElement_property_resizable>` is enabled.
|
|
|
|
.. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
|
|
.. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
|
|
.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
|
|
.. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
|
|
.. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
|
|
.. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`
|
|
.. |bitfield| replace:: :abbr:`BitField (This value is an integer composed as a bitmask of the following flags.)`
|