Inheritance #

EditorProperty
Table of contents

EditorProperty #

is_instantiable, Node, editor, not_builtin_classes

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

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

Members #

var checkable: bool = false#

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

var checked: bool = false#

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

var deletable: bool = false#

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

var draw_background: bool = true#

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

var draw_label: bool = true#

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

var draw_warning: bool = 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.

var keying: bool = false#

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

var label: String = ""#

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

var name_split_ratio: float = 0.5#

Space distribution ratio between the label and the editing field.

var read_only: bool = false#

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

var selectable: bool = true#

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

var use_folding: bool = false#

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

Methods #

virtual func _set_read_only(read_only: bool) -> void#

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.

virtual func _update_property() -> void#

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

func add_focusable(control: Control) -> void#

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.

func deselect() -> void#

Draw property as not selected. Used by the inspector.

func emit_changed(changing: bool = false) -> void#

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

func get_edited_object() -> Object#

Gets the edited object.

const func get_edited_property() -> StringName#

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

const func is_selected() -> bool#

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

func select(focusable: int = -1) -> void#

Draw property as selected. Used by the inspector.

func set_bottom_editor(editor: Control) -> void#

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

func set_label_reference(control: Control) -> void#

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

func set_object_and_property(property: StringName) -> void#

Assigns object and property to edit.

func update_property() -> void#

Forces refresh of the property display.

Annotations #

Constants #

Constructors #

Enums #

Operators #

Signals #

signal multiple_properties_changed(value: Array)#

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

signal object_id_selected(id: int)#

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

signal property_can_revert_changed(can_revert: bool)#

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.

signal property_changed(changing: bool)#

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

signal property_checked(checked: bool)#

Emitted when a property was checked. Used internally.

signal property_deleted(property: StringName)#

Emitted when a property was deleted. Used internally.

signal property_favorited(favorited: bool)#

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

signal property_keyed(property: StringName)#

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

signal property_keyed_with_value(value: Variant)#

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

signal property_pinned(pinned: bool)#

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.

signal resource_selected(resource: Resource)#

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

signal selected(focusable_idx: int)#

Emitted when selected. Used internally.

Theme Items #

Tutorials #