Skip to content

GraphElement

Inherits: Container < Control < CanvasItem < Entity < Object

Inherited by: GraphFrame, GraphNode

A container that represents a basic element that can be placed inside a GraphEdit control.

GraphElement allows to create custom elements for a 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 GraphNode.

Type Name Default
bool draggable true
Vector2 position_offset Vector2(0, 0)
bool resizable false
bool scaling_menus false
bool selectable true
bool selected false

delete_request

delete_request()

Emitted when removing the GraphElement is requested.

dragged

dragged(from: Vector2, to: Vector2)

Emitted when the GraphElement is dragged.

node_deselected

node_deselected()

Emitted when the GraphElement is deselected.

node_selected

node_selected()

Emitted when the GraphElement is selected.

position_offset_changed

position_offset_changed()

Emitted when the GraphElement is moved.

raise_request

raise_request()

Emitted when displaying the GraphElement over other ones is requested. Happens on focusing (clicking into) the GraphElement.

resize_end

resize_end(new_size: Vector2)

Emitted when releasing the mouse button after dragging the resizer handle (see resizable).

resize_request

resize_request(new_size: Vector2)

Emitted when resizing the GraphElement is requested. Happens on dragging the resizer handle (see resizable).

resizer

Texture2D resizer (icon)

draggable

bool draggable = true

If true, the user can drag the GraphElement.

position_offset

Vector2 position_offset = Vector2(0, 0)

The offset of the GraphElement, relative to the scroll offset of the GraphEdit.

resizable

bool resizable = false

If true, the user can resize the GraphElement.

Note: Dragging the handle will only emit the resize_request and resize_end signals, the GraphElement needs to be resized manually.

scaling_menus

bool scaling_menus = false

If true, PopupMenus that are descendants of the GraphElement are scaled with the GraphEdit zoom.

selectable

bool selectable = true

If true, the user can select the GraphElement.

selected

bool selected = false

If true, the GraphElement is selected.