EditorProperty

Hereda: Container < Control < CanvasItem < Node < Object

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

Descripción

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

Propiedades

bool

checkable

false

bool

checked

false

bool

deletable

false

bool

draw_background

true

bool

draw_label

true

bool

draw_warning

false

FocusMode

focus_mode

3 (overrides Control)

bool

keying

false

String

label

""

float

name_split_ratio

0.5

bool

read_only

false

bool

selectable

true

bool

use_folding

false

Métodos

void

_set_read_only(read_only: bool) virtual

void

_update_property() virtual

void

add_focusable(control: Control)

void

deselect()

void

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

Object

get_edited_object()

StringName

get_edited_property() const

bool

is_selected() const

void

select(focusable: int = -1)

void

set_bottom_editor(editor: Control)

void

set_label_reference(control: Control)

void

set_object_and_property(object: Object, property: StringName)

void

update_property()


Señales

multiple_properties_changed(properties: PackedStringArray, value: Array) 🔗

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


object_id_selected(property: StringName, id: int) 🔗

Utilizado por los subinspectores. Emitelo si lo que se seleccionó fue una idde objeto.


property_can_revert_changed(property: StringName, 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.


property_changed(property: StringName, value: Variant, field: StringName, changing: bool) 🔗

No lo emitas manualmente, utiliza en su lugar el método emit_changed().


property_checked(property: StringName, checked: bool) 🔗

Emitida cuando una propiedad fue comprobada. Usada internamente.


property_deleted(property: StringName) 🔗

Emitida al eliminar una propiedad. Usada internamente.


property_favorited(property: StringName, favorited: bool) 🔗

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


property_keyed(property: StringName) 🔗

Emite si quieres añadir este valor como una clave de animación (comprueba que la clave esté activada primero).


property_keyed_with_value(property: StringName, value: Variant) 🔗

Emitelo si quieres poner una clave en una propiedad con un solo valor.


property_overridden() 🔗

Emitida cuando se solicita una sobrescritura de configuración para el proyecto actual.


property_pinned(property: StringName, 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.


resource_selected(path: String, resource: Resource) 🔗

Si quieres que se edite un subrecurso, emite esta señal con el recurso.


selected(path: String, focusable_idx: int) 🔗

Emitida cuando se selecciona. Se utiliza internamente.


Descripciones de Propiedades

bool checkable = false 🔗

  • void set_checkable(value: bool)

  • bool is_checkable()

Usado por el inspector, establecido en true cuando la propiedad es comprobable.


bool checked = false 🔗

  • void set_checked(value: bool)

  • bool is_checked()

Usado por el inspector, establecido en true cuando se comprueba la propiedad.


bool deletable = false 🔗

  • void set_deletable(value: bool)

  • bool is_deletable()

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


bool draw_background = true 🔗

  • void set_draw_background(value: bool)

  • bool is_draw_background()

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


bool draw_label = true 🔗

  • void set_draw_label(value: bool)

  • bool is_draw_label()

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


bool draw_warning = false 🔗

  • void set_draw_warning(value: bool)

  • bool is_draw_warning()

Usado por el inspector, se establece en true cuando la propiedad se dibuja con el color de advertencia del tema del editor. Se usa para propiedades editables de los hijos.


bool keying = false 🔗

  • void set_keying(value: bool)

  • bool is_keying()

Usado por el inspector, establecido en true cuando la propiedad puede añadir teclas para la animación.


String label = "" 🔗

Establezca esta propiedad para cambiar la etiqueta (si quieres mostrar una).


float name_split_ratio = 0.5 🔗

  • void set_name_split_ratio(value: float)

  • float get_name_split_ratio()

Space distribution ratio between the label and the editing field.


bool read_only = false 🔗

  • void set_read_only(value: bool)

  • bool is_read_only()

Usado por el inspector, establecido en true cuando la propiedad es de sólo lectura.


bool selectable = true 🔗

  • void set_selectable(value: bool)

  • bool is_selectable()

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


bool use_folding = false 🔗

  • void set_use_folding(value: bool)

  • bool is_using_folding()

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


Descripciones de Métodos

void _set_read_only(read_only: bool) 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 🔗

Cuando se llama a esta función virtual, tu debes actualizar tu editor.


void add_focusable(control: Control) 🔗

Si alguno de los controles añadidos puede obtener el enfoque del teclado, añádalo aquí. Esto asegura que el enfoque se restaurará si el inspector se refresca.


void deselect() 🔗

Draw property as not selected. Used by the inspector.


void emit_changed(property: StringName, value: Variant, field: StringName = &"", changing: bool = 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.


StringName get_edited_property() const 🔗

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

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 🔗

Devuelve true si la propiedad se dibuja como seleccionada. Usado por el inspector.


void select(focusable: int = -1) 🔗

Dibujar propiedad según la selección. Utilizado por el inspector.


void set_bottom_editor(editor: Control) 🔗

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, property: StringName) 🔗

Asigna objeto y propiedad para editar.


void update_property() 🔗

Fuerza una actualización de la visualización de la propiedad.