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

boolcheckablefalse
boolcheckedfalse
booldraw_redfalse
boolkeyingfalse
Stringlabel“”
boolread_onlyfalse

Methods

voidadd_focusable ( Control control )
voidemit_changed ( String property, Variant value, String field=””, bool changing=false )
Objectget_edited_object ( )
Stringget_edited_property ( )
Stringget_tooltip_text ( ) const
voidset_bottom_editor ( Control editor )
voidupdate_property ( ) virtual

Signals

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


  • object_id_selected ( String property, int id )

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.


  • property_keyed ( String property )

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.


Emitted when selected. Used internally.

Property Descriptions

Defaultfalse
Setterset_checkable(value)
Getteris_checkable()

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


Defaultfalse
Setterset_checked(value)
Getteris_checked()

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


Defaultfalse
Setterset_draw_red(value)
Getteris_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.


Defaultfalse
Setterset_keying(value)
Getteris_keying()

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


Default“”
Setterset_label(value)
Getterget_label()

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


Defaultfalse
Setterset_read_only(value)
Getteris_read_only()

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

Method Descriptions

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


Gets the edited object.


  • String get_edited_property ( )

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

Override if you want to allow a custom tooltip over your property.


  • void set_bottom_editor ( Control editor )

Adds controls with this function if you want them on the bottom (below the label).


  • void update_property ( ) virtual

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