Documentation
¶
Overview ¶
A custom control for editing properties that can be added to the EditorInspector. It is added via EditorInspectorPlugin.
Index ¶
- type Advanced
- type Any
- type Expanded
- type Extension
- func (self *Extension[T]) AsCanvasItem() CanvasItem.Instance
- func (self *Extension[T]) AsContainer() Container.Instance
- func (self *Extension[T]) AsControl() Control.Instance
- func (self *Extension[T]) AsEditorProperty() Instance
- func (self *Extension[T]) AsNode() Node.Instance
- func (self *Extension[T]) AsObject() [1]gd.Object
- type ID
- type Implementation
- type Instance
- func (self Instance) AddFocusable(control Control.Instance)
- func (self Instance) AsCanvasItem() CanvasItem.Instance
- func (self Instance) AsContainer() Container.Instance
- func (self Instance) AsControl() Control.Instance
- func (self Instance) AsEditorProperty() Instance
- func (self Instance) AsNode() Node.Instance
- func (self Instance) AsObject() [1]gd.Object
- func (self Instance) Checkable() bool
- func (self Instance) Checked() bool
- func (self Instance) Deletable() bool
- func (self Instance) Deselect()
- func (self Instance) DrawBackground() bool
- func (self Instance) DrawLabel() bool
- func (self Instance) DrawWarning() bool
- func (self Instance) EmitChanged(property string, value any)
- func (self Instance) GetEditedObject() Object.Instance
- func (self Instance) GetEditedProperty() string
- func (self Instance) ID() ID
- func (self Instance) IsSelected() bool
- func (self Instance) Keying() bool
- func (self Instance) Label() string
- func (self Instance) MoreArgs() MoreArgs
- func (self Instance) NameSplitRatio() Float.X
- func (self Instance) OnMultiplePropertiesChanged(cb func(properties []string, value []any), flags ...Signal.Flags)
- func (self Instance) OnObjectIdSelected(cb func(property string, id int), flags ...Signal.Flags)
- func (self Instance) OnPropertyCanRevertChanged(cb func(property string, can_revert bool), flags ...Signal.Flags)
- func (self Instance) OnPropertyChanged(cb func(property string, value any, field string, changing bool), ...)
- func (self Instance) OnPropertyChecked(cb func(property string, checked bool), flags ...Signal.Flags)
- func (self Instance) OnPropertyDeleted(cb func(property string), flags ...Signal.Flags)
- func (self Instance) OnPropertyFavorited(cb func(property string, favorited bool), flags ...Signal.Flags)
- func (self Instance) OnPropertyKeyed(cb func(property string), flags ...Signal.Flags)
- func (self Instance) OnPropertyKeyedWithValue(cb func(property string, value any), flags ...Signal.Flags)
- func (self Instance) OnPropertyOverridden(cb func(), flags ...Signal.Flags)
- func (self Instance) OnPropertyPinned(cb func(property string, pinned bool), flags ...Signal.Flags)
- func (self Instance) OnResourceSelected(cb func(path string, resource Resource.Instance), flags ...Signal.Flags)
- func (self Instance) OnSelected(cb func(path string, focusable_idx int), flags ...Signal.Flags)
- func (self Instance) ReadOnly() bool
- func (self Instance) Select()
- func (self Instance) Selectable() bool
- func (self Instance) SetBottomEditor(editor Control.Instance)
- func (self Instance) SetCheckable(value bool)
- func (self Instance) SetChecked(value bool)
- func (self Instance) SetDeletable(value bool)
- func (self Instance) SetDrawBackground(value bool)
- func (self Instance) SetDrawLabel(value bool)
- func (self Instance) SetDrawWarning(value bool)
- func (self Instance) SetKeying(value bool)
- func (self Instance) SetLabel(value string)
- func (self Instance) SetLabelReference(control Control.Instance)
- func (self Instance) SetNameSplitRatio(value Float.X)
- func (self *Instance) SetObject(obj [1]gd.Object) bool
- func (self Instance) SetObjectAndProperty(obj Object.Instance, property string)
- func (self Instance) SetSelectable(value bool)
- func (self Instance) SetUseFolding(value bool)
- func (self Instance) UpdateProperty()
- func (self Instance) UseFolding() bool
- func (self Instance) Virtual(name string) reflect.Value
- type Interface
- type MoreArgs
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 Extension ¶
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 (*Extension[T]) AsEditorProperty ¶
type 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.
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 (Instance) AddFocusable ¶
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 (Instance) AsEditorProperty ¶
func (Instance) Deletable ¶
Used by the inspector, set to true when the property can be deleted by the user.
func (Instance) Deselect ¶
func (self Instance) Deselect()
Draw property as not selected. Used by the inspector.
func (Instance) DrawBackground ¶
Used by the inspector, set to true when the property background is drawn.
func (Instance) DrawWarning ¶
Used by the inspector, set to true when the property is drawn with the editor theme's warning color. This is used for editable children's properties.
func (Instance) EmitChanged ¶
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 ¶
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 ¶
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) IsSelected ¶
Returns true if property is drawn as selected. Used by the inspector.
func (Instance) Keying ¶
Used by the inspector, set to true when the property can add keys for animation.
func (Instance) MoreArgs ¶
MoreArgs enables certain functions to be called with additional 'optional' arguments.
func (Instance) NameSplitRatio ¶
Space distribution ratio between the label and the editing field.
func (Instance) OnMultiplePropertiesChanged ¶
func (self Instance) OnMultiplePropertiesChanged(cb func(properties []string, value []any), flags ...Signal.Flags)
Emit it if you want multiple properties modified at the same time. Do not use if added via EditorInspectorPlugin.ParseProperty.
func (Instance) OnObjectIdSelected ¶
Used by sub-inspectors. Emit it if what was selected was an Object ID.
func (Instance) OnPropertyCanRevertChanged ¶
func (self Instance) OnPropertyCanRevertChanged(cb func(property string, can_revert bool), flags ...Signal.Flags)
Emitted when the revertability (i.e., whether it has a non-default value and thus is displayed with a revert icon) of a property has changed.
func (Instance) OnPropertyChanged ¶
func (self Instance) OnPropertyChanged(cb func(property string, value any, field string, changing bool), flags ...Signal.Flags)
Do not emit this manually, use the EmitChanged method instead.
func (Instance) OnPropertyChecked ¶
func (self Instance) OnPropertyChecked(cb func(property string, checked bool), flags ...Signal.Flags)
Emitted when a property was checked. Used internally.
func (Instance) OnPropertyDeleted ¶
Emitted when a property was deleted. Used internally.
func (Instance) OnPropertyFavorited ¶
func (self Instance) OnPropertyFavorited(cb func(property string, favorited bool), flags ...Signal.Flags)
Emit it if you want to mark a property as favorited, making it appear at the top of the inspector.
func (Instance) OnPropertyKeyed ¶
Emit it if you want to add this value as an animation key (check for keying being enabled first).
func (Instance) OnPropertyKeyedWithValue ¶
func (self Instance) OnPropertyKeyedWithValue(cb func(property string, value any), flags ...Signal.Flags)
Emit it if you want to key a property with a single value.
func (Instance) OnPropertyOverridden ¶
Emitted when a setting override for the current project is requested.
func (Instance) OnPropertyPinned ¶
Emit it if you want to mark (or unmark) the value of a property for being saved regardless of being equal to the default value.
The default value is the one the property will get when the node is just instantiated and can come from an ancestor scene in the inheritance/instantiation chain, a script or a builtin class.
func (Instance) OnResourceSelected ¶
func (self Instance) OnResourceSelected(cb func(path string, resource Resource.Instance), flags ...Signal.Flags)
If you want a sub-resource to be edited, emit this signal with the resource.
func (Instance) OnSelected ¶
Emitted when selected. Used internally.
func (Instance) Select ¶
func (self Instance) Select()
Draw property as selected. Used by the inspector.
func (Instance) Selectable ¶
Used by the inspector, set to true when the property is selectable.
func (Instance) SetBottomEditor ¶
Puts the 'editor' control below the property label. The control must be previously added using Node.AddChild.
func (Instance) SetCheckable ¶
SetCheckable sets the property returned by [IsCheckable].
func (Instance) SetChecked ¶
SetChecked sets the property returned by [IsChecked].
func (Instance) SetDeletable ¶
SetDeletable sets the property returned by [IsDeletable].
func (Instance) SetDrawBackground ¶
SetDrawBackground sets the property returned by [IsDrawBackground].
func (Instance) SetDrawLabel ¶
SetDrawLabel sets the property returned by [IsDrawLabel].
func (Instance) SetDrawWarning ¶
SetDrawWarning sets the property returned by [IsDrawWarning].
func (Instance) SetLabelReference ¶
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 ¶
SetNameSplitRatio sets the property returned by [GetNameSplitRatio].
func (Instance) SetObjectAndProperty ¶
Assigns object and property to edit.
func (Instance) SetSelectable ¶
SetSelectable sets the property returned by [IsSelectable].
func (Instance) SetUseFolding ¶
SetUseFolding sets the property returned by [IsUsingFolding].
func (Instance) UpdateProperty ¶
func (self Instance) UpdateProperty()
Forces a refresh of the property display.
func (Instance) UseFolding ¶
Used by the inspector, set to true when the property is using folding.
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 ¶
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).