EditorProperty

Inherits: Container < Control < CanvasItem < Node < Object

Custom control to edit properties for adding into the inspector.

Description

This control allows property editing for one or multiple properties into EditorInspector. It is added via EditorInspectorPlugin.

Properties

bool

checkable

false

bool

checked

false

bool

deletable

false

bool

draw_red

false

bool

keying

false

String

label

""

bool

read_only

false

Methods

void

_update_property ( ) virtual

void

add_focusable ( Control control )

void

emit_changed ( StringName property, Variant value, StringName field=&"", bool changing=false )

Object

get_edited_object ( )

StringName

get_edited_property ( )

String

get_tooltip_text ( ) const

void

set_bottom_editor ( Control editor )

void

update_property ( )

Signals

Emit it if you want multiple properties modified at the same time. Do not use if added via EditorInspectorPlugin._parse_property.


Used by sub-inspectors. Emit it if what was selected was an Object ID.


Do not emit this manually, use the emit_changed method instead.


Emitted when a property was checked. Used internally.


Emitted when a property was deleted. Used internally.


Emit it if you want to add this value as an animation key (check for keying being enabled first).


Emit it if you want to key a property with a single value.


If you want a sub-resource to be edited, emit this signal with the resource.


  • selected ( String path, int focusable_idx )

Emitted when selected. Used internally.

Property Descriptions

Default

false

Setter

set_checkable(value)

Getter

is_checkable()

Used by the inspector, set to true when the property is checkable.


Default

false

Setter

set_checked(value)

Getter

is_checked()

Used by the inspector, set to true when the property is checked.


Default

false

Setter

set_deletable(value)

Getter

is_deletable()

Used by the inspector, set to true when the property can be deleted by the user.


Default

false

Setter

set_draw_red(value)

Getter

is_draw_red()

Used by the inspector, set to true when the property must draw with error color. This is used for editable children's properties.


Default

false

Setter

set_keying(value)

Getter

is_keying()

Used by the inspector, set to true when the property can add keys for animation.


Default

""

Setter

set_label(value)

Getter

get_label()

Set this property to change the label (if you want to show one).


Default

false

Setter

set_read_only(value)

Getter

is_read_only()

Used by the inspector, set to true when the property is read-only.

Method Descriptions

  • void _update_property ( ) virtual

When this virtual function is called, you must update your editor.


  • void add_focusable ( Control control )

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.


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


  • Object get_edited_object ( )

Gets the edited object.


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


  • String get_tooltip_text ( ) const

Must be implemented to provide a custom tooltip to the property editor.


  • void set_bottom_editor ( Control editor )

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


  • void update_property ( )