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.

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

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

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


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

bool checkable = false 🔗

  • void set_checkable(value: bool)

  • bool is_checkable()

Utilisé par l'inspecteur, défini à true lorsque la propriété peut être cochée.


bool checked = false 🔗

  • void set_checked(value: bool)

  • bool is_checked()

Utilisé par l'inspecteur, défini à true quand la propriété est cochée.


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

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.


bool keying = false 🔗

  • void set_keying(value: bool)

  • bool is_keying()

Utilisé par l'inspecteur, définit à true si la propriété peut ajouter une clé pour être animée.


String label = "" 🔗

Réglez cette propriété pour changer l'étiquette (si vous voulez en montrer une).


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

Utilisé par l'inspecteur, défini à true quand la propriété est en lecture-seule.


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.


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


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 🔗

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.