EditorProperty

package
v0.0.0-...-fa94a0d Latest Latest
Warning

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

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

Documentation

Overview

A custom control for editing properties that can be added to the EditorInspector. It is added via EditorInspectorPlugin.

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
	AsEditorProperty() Instance
}

type Expanded

type Expanded = MoreArgs

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]See Interface for methods that can be overridden by T.

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]) AsEditorProperty

func (self *Extension[T]) AsEditorProperty() 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 Implementation

type Implementation = implementation

Implementation implements Interface with empty methods.

type Instance

type Instance [1]gdclass.EditorProperty

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) AddFocusable

func (self Instance) AddFocusable(control Control.Instance)

If any of the controls added can gain keyboard focus, add it here. This ensures that focus will be restored if the inspector is refreshed.

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) AsEditorProperty

func (self Instance) AsEditorProperty() Instance

func (Instance) AsNode

func (self Instance) AsNode() Node.Instance

func (Instance) AsObject

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

func (Instance) Checkable

func (self Instance) Checkable() bool

func (Instance) Checked

func (self Instance) Checked() bool

func (Instance) Deletable

func (self Instance) Deletable() bool

func (Instance) Deselect

func (self Instance) Deselect()

Draw property as not selected. Used by the inspector.

func (Instance) DrawBackground

func (self Instance) DrawBackground() bool

func (Instance) DrawLabel

func (self Instance) DrawLabel() bool

func (Instance) DrawWarning

func (self Instance) DrawWarning() bool

func (Instance) EmitChanged

func (self Instance) EmitChanged(property string, value any)

If one or several properties have changed, this must be called. 'field' is used in case your editor can modify fields separately (as an example, Vector3.x). The 'changing' argument avoids the editor requesting this property to be refreshed (leave as false if unsure).

func (Instance) GetEditedObject

func (self Instance) GetEditedObject() Object.Instance

Returns the edited object.

Note: This method could return null if the editor has not yet been associated with a property. However, in UpdateProperty and SetReadOnly, this value is guaranteed to be non-null.

func (Instance) GetEditedProperty

func (self Instance) GetEditedProperty() string

Returns the edited property. If your editor is for a single property (added via EditorInspectorPlugin.ParseProperty), then this will return the property.

Note: This method could return null if the editor has not yet been associated with a property. However, in UpdateProperty and SetReadOnly, this value is guaranteed to be non-null.

func (Instance) ID

func (self Instance) ID() ID

func (Instance) IsSelected

func (self Instance) IsSelected() bool

Returns true if property is drawn as selected. Used by the inspector.

func (Instance) Keying

func (self Instance) Keying() bool

func (Instance) Label

func (self Instance) Label() string

func (Instance) MoreArgs

func (self Instance) MoreArgs() MoreArgs

MoreArgs enables certain functions to be called with additional 'optional' arguments.

func (Instance) NameSplitRatio

func (self Instance) NameSplitRatio() Float.X

func (Instance) OnMultiplePropertiesChanged

func (self Instance) OnMultiplePropertiesChanged(cb func(properties []string, value []any), flags ...Signal.Flags)

func (Instance) OnObjectIdSelected

func (self Instance) OnObjectIdSelected(cb func(property string, id int), flags ...Signal.Flags)

func (Instance) OnPropertyCanRevertChanged

func (self Instance) OnPropertyCanRevertChanged(cb func(property string, can_revert bool), flags ...Signal.Flags)

func (Instance) OnPropertyChanged

func (self Instance) OnPropertyChanged(cb func(property string, value any, field string, changing bool), flags ...Signal.Flags)

func (Instance) OnPropertyChecked

func (self Instance) OnPropertyChecked(cb func(property string, checked bool), flags ...Signal.Flags)

func (Instance) OnPropertyDeleted

func (self Instance) OnPropertyDeleted(cb func(property string), flags ...Signal.Flags)

func (Instance) OnPropertyFavorited

func (self Instance) OnPropertyFavorited(cb func(property string, favorited bool), flags ...Signal.Flags)

func (Instance) OnPropertyKeyed

func (self Instance) OnPropertyKeyed(cb func(property string), flags ...Signal.Flags)

func (Instance) OnPropertyKeyedWithValue

func (self Instance) OnPropertyKeyedWithValue(cb func(property string, value any), flags ...Signal.Flags)

func (Instance) OnPropertyOverridden

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

func (Instance) OnPropertyPinned

func (self Instance) OnPropertyPinned(cb func(property string, pinned bool), flags ...Signal.Flags)

func (Instance) OnResourceSelected

func (self Instance) OnResourceSelected(cb func(path string, resource Resource.Instance), flags ...Signal.Flags)

func (Instance) OnSelected

func (self Instance) OnSelected(cb func(path string, focusable_idx int), flags ...Signal.Flags)

func (Instance) ReadOnly

func (self Instance) ReadOnly() bool

func (Instance) Select

func (self Instance) Select()

Draw property as selected. Used by the inspector.

func (Instance) Selectable

func (self Instance) Selectable() bool

func (Instance) SetBottomEditor

func (self Instance) SetBottomEditor(editor Control.Instance)

Puts the 'editor' control below the property label. The control must be previously added using Node.AddChild.

func (Instance) SetCheckable

func (self Instance) SetCheckable(value bool)

func (Instance) SetChecked

func (self Instance) SetChecked(value bool)

func (Instance) SetDeletable

func (self Instance) SetDeletable(value bool)

func (Instance) SetDrawBackground

func (self Instance) SetDrawBackground(value bool)

func (Instance) SetDrawLabel

func (self Instance) SetDrawLabel(value bool)

func (Instance) SetDrawWarning

func (self Instance) SetDrawWarning(value bool)

func (Instance) SetKeying

func (self Instance) SetKeying(value bool)

func (Instance) SetLabel

func (self Instance) SetLabel(value string)

func (Instance) SetLabelReference

func (self Instance) SetLabelReference(control Control.Instance)

Used by the inspector, set to a control that will be used as a reference to calculate the size of the label.

func (Instance) SetNameSplitRatio

func (self Instance) SetNameSplitRatio(value Float.X)

func (*Instance) SetObject

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

func (Instance) SetObjectAndProperty

func (self Instance) SetObjectAndProperty(obj Object.Instance, property string)

Assigns object and property to edit.

func (Instance) SetSelectable

func (self Instance) SetSelectable(value bool)

func (Instance) SetUseFolding

func (self Instance) SetUseFolding(value bool)

func (Instance) UpdateProperty

func (self Instance) UpdateProperty()

Forces a refresh of the property display.

func (Instance) UseFolding

func (self Instance) UseFolding() bool

func (Instance) Virtual

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

type Interface

type Interface interface {
	// When this virtual function is called, you must update your editor.
	UpdateProperty()
	// Called when the read-only status of the property is changed. It may be used to change custom controls into a read-only or modifiable state.
	SetReadOnly(read_only bool)
}

type MoreArgs

type MoreArgs [1]gdclass.EditorProperty

MoreArgs is a container for Instance functions with additional 'optional' arguments.

func (MoreArgs) EmitChanged

func (self MoreArgs) EmitChanged(property string, value any, field string, changing bool)

If one or several properties have changed, this must be called. 'field' is used in case your editor can modify fields separately (as an example, Vector3.x). The 'changing' argument avoids the editor requesting this property to be refreshed (leave as false if unsure).

func (MoreArgs) Select

func (self MoreArgs) Select(focusable int)

Draw property as selected. Used by the inspector.

Jump to

Keyboard shortcuts

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