Documentation
¶
Overview ¶
Package EditorInspectorPlugin provides methods for working with EditorInspectorPlugin object instances.
Index ¶
- type Advanced
- type Any
- type Expanded
- type Extension
- type ID
- type Implementation
- type Instance
- func (self Instance) AddCustomControl(control Control.Instance)
- func (self Instance) AddPropertyEditor(property string, editor Control.Instance)
- func (self Instance) AddPropertyEditorForMultipleProperties(label string, properties []string, editor Control.Instance)
- func (self Instance) AsEditorInspectorPlugin() Instance
- func (self Instance) AsObject() [1]gd.Object
- func (self Instance) AsRefCounted() [1]gd.RefCounted
- func (self Instance) ID() ID
- func (self *Instance) SetObject(obj [1]gd.Object) bool
- func (self Instance) Virtual(name string) reflect.Value
- type Interface
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 Expanded ¶
type Expanded [1]gdclass.EditorInspectorPlugin
func (Expanded) AddPropertyEditor ¶
func (self Expanded) AddPropertyEditor(property string, editor Control.Instance, add_to_end bool, label string)
Adds a property editor for an individual property. The [param editor] control must extend [EditorProperty]. There can be multiple property editors for a property. If [param add_to_end] is [code]true[/code], this newly added editor will be displayed after all the other editors of the property whose [param add_to_end] is [code]false[/code]. For example, the editor uses this parameter to add an "Edit Region" button for [member Sprite2D.region_rect] below the regular [Rect2] editor. [param label] can be used to choose a custom label for the property editor in the inspector. If left empty, the label is computed from the name of the property instead.
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
func (*Extension[T]) AsEditorInspectorPlugin ¶
func (*Extension[T]) AsRefCounted ¶
func (self *Extension[T]) AsRefCounted() [1]gd.RefCounted
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.EditorInspectorPlugin
[EditorInspectorPlugin] allows adding custom property editors to [EditorInspector]. When an object is edited, the [method _can_handle] function is called and must return [code]true[/code] if the object type is supported. If supported, the function [method _parse_begin] will be called, allowing to place custom controls at the beginning of the class. Subsequently, the [method _parse_category] and [method _parse_property] are called for every category and property. They offer the ability to add custom controls to the inspector too. Finally, [method _parse_end] will be called. On each of these calls, the "add" functions can be called. To use [EditorInspectorPlugin], register it using the [method EditorPlugin.add_inspector_plugin] method first.
See [Interface] for methods that can be overridden by a [Class] that extends it.
var Nil Instance
Nil is a nil/null instance of the class. Equivalent to the zero value.
func (Instance) AddCustomControl ¶
Adds a custom control, which is not necessarily a property editor.
func (Instance) AddPropertyEditor ¶
Adds a property editor for an individual property. The [param editor] control must extend [EditorProperty]. There can be multiple property editors for a property. If [param add_to_end] is [code]true[/code], this newly added editor will be displayed after all the other editors of the property whose [param add_to_end] is [code]false[/code]. For example, the editor uses this parameter to add an "Edit Region" button for [member Sprite2D.region_rect] below the regular [Rect2] editor. [param label] can be used to choose a custom label for the property editor in the inspector. If left empty, the label is computed from the name of the property instead.
func (Instance) AddPropertyEditorForMultipleProperties ¶
func (self Instance) AddPropertyEditorForMultipleProperties(label string, properties []string, editor Control.Instance)
Adds an editor that allows modifying multiple properties. The [param editor] control must extend [EditorProperty].
func (Instance) AsEditorInspectorPlugin ¶
func (Instance) AsRefCounted ¶
func (self Instance) AsRefCounted() [1]gd.RefCounted
type Interface ¶
type Interface interface { //Returns [code]true[/code] if this object can be handled by this plugin. CanHandle(obj Object.Instance) bool //Called to allow adding controls at the beginning of the property list for [param object]. ParseBegin(obj Object.Instance) //Called to allow adding controls at the beginning of a category in the property list for [param object]. ParseCategory(obj Object.Instance, category string) //Called to allow adding controls at the beginning of a group or a sub-group in the property list for [param object]. ParseGroup(obj Object.Instance, group string) //Called to allow adding property-specific editors to the property list for [param object]. The added editor control must extend [EditorProperty]. Returning [code]true[/code] removes the built-in editor for this property, otherwise allows to insert a custom editor before the built-in one. ParseProperty(obj Object.Instance, atype variant.Type, name string, hint_type ClassDB.PropertyHint, hint_string string, usage_flags ClassDB.PropertyUsageFlags, wide bool) bool //Called to allow adding controls at the end of the property list for [param object]. ParseEnd(obj Object.Instance) }