Class reference

EditorProperty

Inherits Container

Custom control for editing properties that can be added to the EditorInspector.

Description

A custom control for editing properties that can be added to the EditorInspector. It is added via EditorInspectorPlugin.

Properties

bool checkable = false

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

bool checked = false

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

bool deletable = false

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

bool draw_background = true

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

bool draw_label = true

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

bool draw_warning = false

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.

int focus_mode = 3

bool keying = false

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

String label = ""

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

float name_split_ratio = 0.5

Space distribution ratio between the label and the editing field.

bool read_only = false

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

bool selectable = true

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

bool use_folding = false

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

Methods

void _set_read_only(bool read_only) virtual

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.

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.

void deselect()

Draw property as not selected. Used by the inspector.

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

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

Returns the edited object. Note: This method could return null if the editor has not yet been associated with a property. However, in _update_property() and _set_read_only(), this value is guaranteed to be non-null.

bool is_selected() const

Returns true if property is drawn as selected. Used by the inspector.

void select(int focusable = -1)

Draw property as selected. Used by the inspector.

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 set_label_reference(Control control)

Used by the inspector, set to a control that will be used as a reference to calculate the size of the label.

void set_object_and_property(Object object, StringName property)

Assigns object and property to edit.

void update_property()

Forces a refresh of the property display.

Signals

object_id_selected(StringName property, int id)

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

property_can_revert_changed(StringName property, bool can_revert)

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.

property_checked(StringName property, bool checked)

Emitted when a property was checked. Used internally.

property_deleted(StringName property)

Emitted when a property was deleted. Used internally.

property_favorited(StringName property, bool favorited)

Emit it if you want to mark a property as favorited, making it appear at the top of the inspector.

property_keyed(StringName property)

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

property_keyed_with_value(StringName property, Variant value)

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

property_overridden()

Emitted when a setting override for the current project is requested.

property_pinned(StringName property, bool pinned)

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.

resource_selected(String path, Resource resource)

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.

Source revision 5592dc3a7a61
Connection interrupted. Reload×

Rejoining the server...

Rejoin failed... trying again in seconds.

Failed to rejoin.
Please retry or reload the page.

The session has been paused by the server.

Failed to resume the session.
Please retry or reload the page.