Attention: Here be dragons
This is the latest
(unstable) version of this documentation, which may document features
not available in or compatible with released stable versions of Godot.
Checking the stable version of the documentation...
EditorProperty
Hérite de : Container < Control < CanvasItem < Node < Object
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.
Propriétés
|
||
|
||
|
||
|
||
|
||
|
||
focus_mode |
|
|
|
||
|
||
|
||
|
||
|
||
|
Méthodes
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 |
Signaux
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) 🔗
Utilisé par des sous-inspecteurs. Émettez-le si l'identifiant d'un Object a été sélectionné.
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) 🔗
Ne l'émettez pas manuellement, utilisez plutôt la méthode emit_changed().
property_checked(property: StringName, checked: bool) 🔗
Émis lors de la vérification d’une propriété. Utilisé en interne.
property_deleted(property: StringName) 🔗
Émis lorsqu'une propriété a été supprimée. Utilisé en interne.
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) 🔗
Émettez-le si vous voulez ajouter cette valeur comme clé d'animation (vérifiez que la clé est d'abord activée).
property_keyed_with_value(property: StringName, value: Variant) 🔗
Emettez-le si vous voulez définir une clé pour cette propriété avec une valeur unique.
property_overridden() 🔗
Emitted when a setting override for the current project is requested.
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 vous voulez que la sous-ressource soit modifié, émettez ce signal avec cette ressource.
selected(path: String, focusable_idx: int) 🔗
Émis lors de la sélection. Utilisé en interne.
Descriptions des propriétés
Utilisé par l'inspecteur, défini à true lorsque la propriété peut être cochée.
Utilisé par l'inspecteur, défini à true quand la propriété est cochée.
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.
Utilisé par l'inspecteur, définit à true quand la propriété est affiché avec la couleur d'avertissement de l'éditeur. Ceci est utilisé pour les propriétés modifiables pour les nœuds enfants.
Utilisé par l'inspecteur, définit à true si la propriété peut ajouter une clé pour être animée.
Réglez cette propriété pour changer l'étiquette (si vous voulez en montrer une).
float name_split_ratio = 0.5 🔗
Space distribution ratio between the label and the editing field.
Utilisé par l'inspecteur, défini à true quand la propriété est en lecture-seule.
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.
Descriptions des méthodes
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 🔗
Lorsque cette fonction virtuelle est appelée, vous devez mettre à jour votre éditeur.
void add_focusable(control: Control) 🔗
Si l'un des contrôles ajoutés peut récupérer le focus du clavier, ajoutez-le ici. Cela permettra de rétablir le focus si l'inspecteur est mis à jour.
void deselect() 🔗
Draw property as not selected. Used by the inspector.
void emit_changed(property: StringName, value: Variant, field: StringName = &"", changing: bool = false) 🔗
Si une ou plusieurs propriétés ont changé, ceci doit être appelé. field est utilisé au cas où votre éditeur peut modifier les champs séparément (par exemple : Vector3.x) L'argument changing évite à l'éditeur de demander que cette propriété soit rafraîchie (laissez-le à false en cas de doute).
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.
Returns true if property is drawn as selected. Used by the inspector.
void select(focusable: int = -1) 🔗
Draw property as selected. Used by the inspector.
void set_bottom_editor(editor: Control) 🔗
Place le contrôle editor sous le label de la propriété. Le contrôle doit d'abord être ajouté avec 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) 🔗
Assigns object and property to edit.
void update_property() 🔗
Forces a refresh of the property display.