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
|
||
|
||
|
||
|
||
|
||
|
||
focus_mode |
|
|
|
||
|
||
|
||
|
||
|
||
|
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) |
get_edited_property() const |
|
is_selected() const |
|
void |
|
void |
set_bottom_editor(editor: Control) |
void |
set_label_reference(control: Control) |
void |
set_object_and_property(object: Object, property: StringName) |
void |
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
Usado por el inspector, establecido en true cuando la propiedad es comprobable.
Usado por el inspector, establecido en true cuando se comprueba la propiedad.
Used by the inspector, set to true when the property can be deleted by the user.
Used by the inspector, set to true when the property background is drawn.
Used by the inspector, set to true when the property label is drawn.
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.
Usado por el inspector, establecido en true cuando la propiedad puede añadir teclas para la animación.
Establezca esta propiedad para cambiar la etiqueta (si quieres mostrar una).
float name_split_ratio = 0.5 🔗
Space distribution ratio between the label and the editing field.
Usado por el inspector, establecido en true cuando la propiedad es de sólo lectura.
Used by the inspector, set to true when the property is selectable.
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).
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.
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.