EditorInspector

package
v0.0.0-...-535787f Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2025 License: MIT Imports: 30 Imported by: 0

Documentation

Overview

This is the control that implements property editing in the editor's Settings dialogs, the Inspector dock, etc. To get the graphics.gd/classdb/EditorInspector used in the editor's Inspector dock, use graphics.gd/classdb/EditorInterface.GetInspector.

graphics.gd/classdb/EditorInspector will show properties in the same order as the array returned by graphics.gd/classdb/Object.Instance.GetPropertyList.

If a property's name is path-like (i.e. if it contains forward slashes), graphics.gd/classdb/EditorInspector will create nested sections for "directories" along the path. For example, if a property is named highlighting/gdscript/node_path_color, it will be shown as "Node Path Color" inside the "GDScript" section nested inside the "Highlighting" section.

If a property has [PropertyUsageGroup] usage, it will group subsequent properties whose name starts with the property's hint string. The group ends when a property does not start with that hint string or when a new group starts. An empty group name effectively ends the current group. graphics.gd/classdb/EditorInspector will create a top-level section for each group. For example, if a property with group usage is named Collide With and its hint string is collide_with_, a subsequent collide_with_area property will be shown as "Area" inside the "Collide With" section. There is also a special case: when the hint string contains the name of a property, that property is grouped too. This is mainly to help grouping properties like font, font_color and font_size (using the hint string font_).

If a property has [PropertyUsageSubgroup] usage, a subgroup will be created in the same way as a group, and a second-level section will be created for each subgroup.

Note: Unlike sections created from path-like property names, graphics.gd/classdb/EditorInspector won't capitalize the name for sections created from groups. So properties with group usage usually use capitalized names instead of snake_cased names.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InstantiatePropertyEditor

func InstantiatePropertyEditor(obj Object.Instance, atype variant.Type, path string, hint ClassDB.PropertyHint, hint_text string, usage int, wide bool) EditorProperty.Instance

Creates a property editor that can be used by plugin UI to edit the specified property of an 'object'.

func InstantiatePropertyEditorOptions

func InstantiatePropertyEditorOptions(obj Object.Instance, atype variant.Type, path string, hint ClassDB.PropertyHint, hint_text string, usage int, wide bool) EditorProperty.Instance

Creates a property editor that can be used by plugin UI to edit the specified property of an 'object'.

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
	AsEditorInspector() 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]) AsEditorInspector

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

func (*Extension[T]) AsNode

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

func (*Extension[T]) AsObject

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

func (*Extension[T]) AsScrollContainer

func (self *Extension[T]) AsScrollContainer() ScrollContainer.Instance

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.EditorInspector

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

func (self Instance) AsEditorInspector() Instance

func (Instance) AsNode

func (self Instance) AsNode() Node.Instance

func (Instance) AsObject

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

func (Instance) AsScrollContainer

func (self Instance) AsScrollContainer() ScrollContainer.Instance

func (Instance) Edit

func (self Instance) Edit(obj Object.Instance)

Shows the properties of the given 'object' in this inspector for editing. To clear the inspector, call this method with null.

Note: If you want to edit an object in the editor's main inspector, use the edit_* methods in graphics.gd/classdb/EditorInterface instead.

func (Instance) GetEditedObject

func (self Instance) GetEditedObject() Object.Instance

Returns the object currently selected in this inspector.

func (Instance) GetSelectedPath

func (self Instance) GetSelectedPath() string

Gets the path of the currently selected property.

func (Instance) ID

func (self Instance) ID() ID

func (Instance) OnEditedObjectChanged

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

func (Instance) OnObjectIdSelected

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

func (Instance) OnPropertyDeleted

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

func (Instance) OnPropertyEdited

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

func (Instance) OnPropertyKeyed

func (self Instance) OnPropertyKeyed(cb func(property string, value any, advance bool), flags ...Signal.Flags)

func (Instance) OnPropertySelected

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

func (Instance) OnPropertyToggled

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

func (Instance) OnResourceSelected

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

func (Instance) OnRestartRequested

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

func (*Instance) SetObject

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

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