GraphElement

package
v0.0.0-...-357ca8a Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 20, 2025 License: MIT Imports: 28 Imported by: 0

Documentation

Overview

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.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Advanced

type Advanced = class

Advanced exposes a 1:1 low-level instance of the class, undocumented, for those who know what they are doing.

type Any

type Any interface {
	gd.IsClass
	AsGraphElement() Instance
}

type Extension

type Extension[T gdclass.Interface] struct{ gdclass.Extension[T, Instance] }

Extension can be embedded in a new struct to create an extension of this class. T should be the type that is embedding this Extension

func (*Extension[T]) AsCanvasItem

func (self *Extension[T]) AsCanvasItem() CanvasItem.Instance

func (*Extension[T]) AsContainer

func (self *Extension[T]) AsContainer() Container.Instance

func (*Extension[T]) AsControl

func (self *Extension[T]) AsControl() Control.Instance

func (*Extension[T]) AsGraphElement

func (self *Extension[T]) AsGraphElement() Instance

func (*Extension[T]) AsNode

func (self *Extension[T]) AsNode() Node.Instance

func (*Extension[T]) AsObject

func (self *Extension[T]) AsObject() [1]gd.Object

type ID

type ID Object.ID

ID is a typed object ID (reference) to an instance of this class, use it to store references to objects with unknown lifetimes, as an ID will not panic on use if the underlying object has been destroyed.

func (ID) Instance

func (id ID) Instance() (Instance, bool)

type Instance

type Instance [1]gdclass.GraphElement

Instance of the class with convieniently typed arguments and results.

var Nil Instance

Nil is a nil/null instance of the class. Equivalent to the zero value.

func New

func New() Instance

func (Instance) AsCanvasItem

func (self Instance) AsCanvasItem() CanvasItem.Instance

func (Instance) AsContainer

func (self Instance) AsContainer() Container.Instance

func (Instance) AsControl

func (self Instance) AsControl() Control.Instance

func (Instance) AsGraphElement

func (self Instance) AsGraphElement() Instance

func (Instance) AsNode

func (self Instance) AsNode() Node.Instance

func (Instance) AsObject

func (self Instance) AsObject() [1]gd.Object

func (Instance) Draggable

func (self Instance) Draggable() bool

If true, the user can drag the GraphElement.

func (Instance) ID

func (self Instance) ID() ID

func (Instance) OnDeleteRequest

func (self Instance) OnDeleteRequest(cb func(), flags ...Signal.Flags)

Emitted when removing the GraphElement is requested.

func (Instance) OnDragged

func (self Instance) OnDragged(cb func(from Vector2.XY, to Vector2.XY), flags ...Signal.Flags)

Emitted when the GraphElement is dragged.

func (Instance) OnNodeDeselected

func (self Instance) OnNodeDeselected(cb func(), flags ...Signal.Flags)

Emitted when the GraphElement is deselected.

func (Instance) OnNodeSelected

func (self Instance) OnNodeSelected(cb func(), flags ...Signal.Flags)

Emitted when the GraphElement is selected.

func (Instance) OnPositionOffsetChanged

func (self Instance) OnPositionOffsetChanged(cb func(), flags ...Signal.Flags)

Emitted when the GraphElement is moved.

func (Instance) OnRaiseRequest

func (self Instance) OnRaiseRequest(cb func(), flags ...Signal.Flags)

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

func (Instance) OnResizeEnd

func (self Instance) OnResizeEnd(cb func(new_size Vector2.XY), flags ...Signal.Flags)

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

func (Instance) OnResizeRequest

func (self Instance) OnResizeRequest(cb func(new_size Vector2.XY), flags ...Signal.Flags)

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

func (Instance) PositionOffset

func (self Instance) PositionOffset() Vector2.XY

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

func (Instance) Resizable

func (self Instance) Resizable() bool

If true, the user can resize the GraphElement.

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

func (Instance) Selectable

func (self Instance) Selectable() bool

If true, the user can select the GraphElement.

func (Instance) Selected

func (self Instance) Selected() bool

If true, the GraphElement is selected.

func (Instance) SetDraggable

func (self Instance) SetDraggable(value bool)

SetDraggable sets the property returned by [IsDraggable].

func (*Instance) SetObject

func (self *Instance) SetObject(obj [1]gd.Object) bool

func (Instance) SetPositionOffset

func (self Instance) SetPositionOffset(value Vector2.XY)

SetPositionOffset sets the property returned by [GetPositionOffset].

func (Instance) SetResizable

func (self Instance) SetResizable(value bool)

SetResizable sets the property returned by [IsResizable].

func (Instance) SetSelectable

func (self Instance) SetSelectable(value bool)

SetSelectable sets the property returned by [IsSelectable].

func (Instance) SetSelected

func (self Instance) SetSelected(value bool)

SetSelected sets the property returned by [IsSelected].

func (Instance) Virtual

func (self Instance) Virtual(name string) reflect.Value

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL