Trait IEditorPlugin
pub trait IEditorPlugin: GodotClass<Base = EditorPlugin> + You_forgot_the_attribute__godot_api {
Show 45 methods
// Provided methods
fn init(base: Base<Self::Base>) -> Self { ... }
fn enter_tree(&mut self) { ... }
fn ready(&mut self) { ... }
fn exit_tree(&mut self) { ... }
fn process(&mut self, delta: f64) { ... }
fn physics_process(&mut self, delta: f64) { ... }
fn input(&mut self, event: Gd<InputEvent>) { ... }
fn shortcut_input(&mut self, event: Gd<InputEvent>) { ... }
fn unhandled_key_input(&mut self, event: Gd<InputEvent>) { ... }
fn unhandled_input(&mut self, event: Gd<InputEvent>) { ... }
fn on_notification(&mut self, what: NodeNotification) { ... }
fn on_get(&self, property: StringName) -> Option<Variant> { ... }
fn on_set(&mut self, property: StringName, value: Variant) -> bool { ... }
fn on_validate_property(&self, property: &mut PropertyInfo) { ... }
fn on_get_property_list(&mut self) -> Vec<PropertyInfo> { ... }
fn on_property_get_revert(&self, property: StringName) -> Option<Variant> { ... }
fn to_string(&self) -> GString { ... }
fn forward_canvas_gui_input(
&mut self,
event: Option<Gd<InputEvent>>,
) -> bool { ... }
fn forward_canvas_draw_over_viewport(
&mut self,
viewport_control: Option<Gd<Control>>,
) { ... }
fn forward_canvas_force_draw_over_viewport(
&mut self,
viewport_control: Option<Gd<Control>>,
) { ... }
fn forward_3d_gui_input(
&mut self,
viewport_camera: Option<Gd<Camera3D>>,
event: Option<Gd<InputEvent>>,
) -> i32 { ... }
fn forward_3d_draw_over_viewport(
&mut self,
viewport_control: Option<Gd<Control>>,
) { ... }
fn forward_3d_force_draw_over_viewport(
&mut self,
viewport_control: Option<Gd<Control>>,
) { ... }
fn get_plugin_name(&self) -> GString { ... }
fn get_plugin_icon(&self) -> Option<Gd<Texture2D>> { ... }
fn has_main_screen(&self) -> bool { ... }
fn make_visible(&mut self, visible: bool) { ... }
fn edit(&mut self, object: Option<Gd<Object>>) { ... }
fn handles(&self, object: Gd<Object>) -> bool { ... }
fn get_state(&self) -> AnyDictionary { ... }
fn set_state(&mut self, state: Dictionary<Variant, Variant>) { ... }
fn clear(&mut self) { ... }
fn get_unsaved_status(&self, for_scene: GString) -> GString { ... }
fn save_external_data(&mut self) { ... }
fn apply_changes(&mut self) { ... }
fn get_breakpoints(&self) -> PackedArray<GString> { ... }
fn set_window_layout(&mut self, configuration: Option<Gd<ConfigFile>>) { ... }
fn get_window_layout(&mut self, configuration: Option<Gd<ConfigFile>>) { ... }
fn build(&mut self) -> bool { ... }
fn run_scene(
&self,
scene: GString,
args: PackedArray<GString>,
) -> PackedArray<GString> { ... }
fn enable_plugin(&mut self) { ... }
fn disable_plugin(&mut self) { ... }
fn get_configuration_warnings(&self) -> PackedArray<GString> { ... }
fn get_accessibility_configuration_warnings(&self) -> PackedArray<GString> { ... }
fn get_focused_accessibility_element(&self) -> Rid { ... }
}Expand description
§Interface trait for class EditorPlugin.
Functions in this trait represent constructors (init) or virtual method callbacks invoked by the engine.
§Related symbols
Base interfaces: INode > IObject.
See also Godot docs for EditorPlugin methods.
Provided Methods§
fn init(base: Base<Self::Base>) -> Self
fn init(base: Base<Self::Base>) -> Self
Godot constructor, accepting an injected base object.
base refers to the base instance of the class, which can either be stored in a Base<T> field or discarded.
This method returns a fully-constructed instance, which will then be moved into a Gd<T> pointer.
If the class has a #[class(init)] attribute, this method will be auto-generated and must not be overridden.
fn enter_tree(&mut self)
fn enter_tree(&mut self)
Called when the node enters the SceneTree (e.g. upon instantiating, scene changing, or after calling add_child in a script). If the node has children, its enter_tree callback will be called first, and then that of the children.
Corresponds to the NodeNotification::ENTER_TREE notification in on_notification.
fn ready(&mut self)
fn ready(&mut self)
Called when the node is “ready”, i.e. when both the node and its children have entered the scene tree. If the node has children, their ready callbacks get triggered first, and the parent node will receive the ready notification afterwards.
Corresponds to the NodeNotification::READY notification in on_notification. See also the @onready annotation for variables.
Usually used for initialization. For even earlier initialization, init may be used. See also enter_tree.
Note: This method may be called only once for each node. After removing a node from the scene tree and adding it again, ready will not be called a second time. This can be bypassed by requesting another call with request_ready, which may be called anywhere before adding the node again.
fn exit_tree(&mut self)
fn exit_tree(&mut self)
Called when the node is about to leave the SceneTree (e.g. upon freeing, scene changing, or after calling remove_child in a script). If the node has children, its exit_tree callback will be called last, after all its children have left the tree.
Corresponds to the NodeNotification::EXIT_TREE notification in on_notification and signal tree_exiting. To get notified when the node has already left the active tree, connect to the tree_exited.
fn process(&mut self, delta: f64)
fn process(&mut self, delta: f64)
Called on each idle frame, prior to rendering, and after physics ticks have been processed. delta is the time between frames in seconds.
It is only called if processing is enabled for this Node, which is done automatically if this method is overridden, and can be toggled with set_process.
Processing happens in order of [member process_priority], lower priority values are called first. Nodes with the same priority are processed in tree order, or top to bottom as seen in the editor (also known as pre-order traversal).
Corresponds to the NodeNotification::PROCESS notification in on_notification.
Note: This method is only called if the node is present in the scene tree (i.e. if it’s not an orphan).
Note: When the engine is struggling and the frame rate is lowered, delta will increase. When delta is increased, it’s capped at a maximum of [member Engine.time_scale] * [member Engine.max_physics_steps_per_frame] / [member Engine.physics_ticks_per_second]. As a result, accumulated delta may not represent real world time.
Note: When --fixed-fps is enabled or the engine is running in Movie Maker mode (see MovieWriter), process delta will always be the same for every frame, regardless of how much time the frame took to render.
Note: Frame delta may be post-processed by [member OS.delta_smoothing] if this is enabled for the project.
fn physics_process(&mut self, delta: f64)
fn physics_process(&mut self, delta: f64)
Called once on each physics tick, and allows Nodes to synchronize their logic with physics ticks. delta is the logical time between physics ticks in seconds and is equal to [member Engine.time_scale] / [member Engine.physics_ticks_per_second].
It is only called if physics processing is enabled for this Node, which is done automatically if this method is overridden, and can be toggled with set_physics_process.
Processing happens in order of [member process_physics_priority], lower priority values are called first. Nodes with the same priority are processed in tree order, or top to bottom as seen in the editor (also known as pre-order traversal).
Corresponds to the NodeNotification::PHYSICS_PROCESS notification in on_notification.
Note: This method is only called if the node is present in the scene tree (i.e. if it’s not an orphan).
Note: Accumulated delta may diverge from real world seconds.
fn input(&mut self, event: Gd<InputEvent>)
fn input(&mut self, event: Gd<InputEvent>)
Called when there is an input event. The input event propagates up through the node tree until a node consumes it.
It is only called if input processing is enabled, which is done automatically if this method is overridden, and can be toggled with set_process_input.
To consume the input event and stop it propagating further to other nodes, set_input_as_handled can be called.
For gameplay input, unhandled_input and unhandled_key_input are usually a better fit as they allow the GUI to intercept the events first.
Note: This method is only called if the node is present in the scene tree (i.e. if it’s not an orphan).
fn shortcut_input(&mut self, event: Gd<InputEvent>)
fn shortcut_input(&mut self, event: Gd<InputEvent>)
Called when an InputEventKey, InputEventShortcut, or InputEventJoypadButton hasn’t been consumed by input or any GUI Control item. It is called before unhandled_key_input and unhandled_input. The input event propagates up through the node tree until a node consumes it.
It is only called if shortcut processing is enabled, which is done automatically if this method is overridden, and can be toggled with set_process_shortcut_input.
To consume the input event and stop it propagating further to other nodes, set_input_as_handled can be called.
This method can be used to handle shortcuts. For generic GUI events, use input instead. Gameplay events should usually be handled with either unhandled_input or unhandled_key_input.
Note: This method is only called if the node is present in the scene tree (i.e. if it’s not orphan).
fn unhandled_key_input(&mut self, event: Gd<InputEvent>)
fn unhandled_key_input(&mut self, event: Gd<InputEvent>)
Called when an InputEventKey hasn’t been consumed by input or any GUI Control item. It is called after shortcut_input but before unhandled_input. The input event propagates up through the node tree until a node consumes it.
It is only called if unhandled key input processing is enabled, which is done automatically if this method is overridden, and can be toggled with set_process_unhandled_key_input.
To consume the input event and stop it propagating further to other nodes, set_input_as_handled can be called.
This method can be used to handle Unicode character input with Alt, Alt + Ctrl, and Alt + Shift modifiers, after shortcuts were handled.
For gameplay input, this and unhandled_input are usually a better fit than input, as GUI events should be handled first. This method also performs better than unhandled_input, since unrelated events such as InputEventMouseMotion are automatically filtered. For shortcuts, consider using shortcut_input instead.
Note: This method is only called if the node is present in the scene tree (i.e. if it’s not an orphan).
fn unhandled_input(&mut self, event: Gd<InputEvent>)
fn unhandled_input(&mut self, event: Gd<InputEvent>)
Called when an InputEvent hasn’t been consumed by input or any GUI Control item. It is called after shortcut_input and after unhandled_key_input. The input event propagates up through the node tree until a node consumes it.
It is only called if unhandled input processing is enabled, which is done automatically if this method is overridden, and can be toggled with set_process_unhandled_input.
To consume the input event and stop it propagating further to other nodes, set_input_as_handled can be called.
For gameplay input, this method is usually a better fit than input, as GUI events need a higher priority. For keyboard shortcuts, consider using shortcut_input instead, as it is called before this method. Finally, to handle keyboard events, consider using unhandled_key_input for performance reasons.
Note: This method is only called if the node is present in the scene tree (i.e. if it’s not an orphan).
fn on_notification(&mut self, what: NodeNotification)
fn on_notification(&mut self, what: NodeNotification)
Called when the object receives a Godot notification.
The type of notification can be identified through what. The enum is designed to hold all possible NOTIFICATION_*
constants that the current class can handle. However, this is not validated in Godot, so an enum variant Unknown exists
to represent integers out of known constants (mistakes or future additions).
This method is named _notification in Godot, but on_notification in Rust. To send notifications, use the
Object::notify method.
See also in Godot docs:
fn on_get(&self, property: StringName) -> Option<Variant>
fn on_get(&self, property: StringName) -> Option<Variant>
Called whenever get() is called or Godot gets the value of a property.
Should return the given property’s value as Some(value), or None if the property should be handled normally.
See also in Godot docs:
fn on_set(&mut self, property: StringName, value: Variant) -> bool
fn on_set(&mut self, property: StringName, value: Variant) -> bool
Called whenever Godot set() is called or Godot sets the value of a property.
Should set property to the given value and return true, or return false to indicate the property
should be handled normally.
See also in Godot docs:
fn on_validate_property(&self, property: &mut PropertyInfo)
fn on_validate_property(&self, property: &mut PropertyInfo)
Called whenever Godot retrieves value of property. Allows to customize existing properties.
Every property info goes through this method, except properties added with on_get_property_list().
Exposed property here is a shared mutable reference obtained (and returned to) from Godot.
See also in the Godot docs:
fn on_get_property_list(&mut self) -> Vec<PropertyInfo>
Available on since_api=4.3 only.
fn on_get_property_list(&mut self) -> Vec<PropertyInfo>
since_api=4.3 only.Called whenever Godot get_property_list() is called, the returned vector here is
appended to the existing list of properties.
This should mainly be used for advanced purposes, such as dynamically updating the property list in the editor.
See also in Godot docs:
fn on_property_get_revert(&self, property: StringName) -> Option<Variant>
fn on_property_get_revert(&self, property: StringName) -> Option<Variant>
Called by Godot to tell if a property has a custom revert or not.
Return None for no custom revert, and return Some(value) to specify the custom revert.
This is a combination of Godot’s Object::_property_get_revert and Object::_property_can_revert. This means that this
function will usually be called twice by Godot to find the revert.
Note that this should be a pure function. That is, it should always return the same value for a property as long as self
remains unchanged. Otherwise, this may lead to unexpected (safe) behavior.
fn to_string(&self) -> GString
fn to_string(&self) -> GString
String representation of the Godot instance.
Override this method to define how the instance is represented as a string.
Used by impl Display for Gd<T>, as well as str() and print() in GDScript.
fn forward_canvas_gui_input(&mut self, event: Option<Gd<InputEvent>>) -> bool
fn forward_canvas_gui_input(&mut self, event: Option<Gd<InputEvent>>) -> bool
Called when there is a root node in the current edited scene, handles is implemented, and an InputEvent happens in the 2D viewport. If this method returns true, event is intercepted by this EditorPlugin, otherwise event is forwarded to other Editor classes.
# Prevents the InputEvent from reaching other Editor classes.
func _forward_canvas_gui_input(event):
return trueThis method must return false in order to forward the InputEvent to other Editor classes.
# Consumes InputEventMouseMotion and forwards other InputEvent types.
func _forward_canvas_gui_input(event):
if (event is InputEventMouseMotion):
return true
return falsefn forward_canvas_draw_over_viewport(
&mut self,
viewport_control: Option<Gd<Control>>,
)
fn forward_canvas_draw_over_viewport( &mut self, viewport_control: Option<Gd<Control>>, )
Called by the engine when the 2D editor’s viewport is updated. viewport_control is an overlay on top of the viewport and it can be used for drawing. You can update the viewport manually by calling update_overlays.
func _forward_canvas_draw_over_viewport(overlay):
# Draw a circle at the cursor's position.
overlay.draw_circle(overlay.get_local_mouse_position(), 64, Color.WHITE)
func _forward_canvas_gui_input(event):
if event is InputEventMouseMotion:
# Redraw the viewport when the cursor is moved.
update_overlays()
return true
return falsefn forward_canvas_force_draw_over_viewport(
&mut self,
viewport_control: Option<Gd<Control>>,
)
fn forward_canvas_force_draw_over_viewport( &mut self, viewport_control: Option<Gd<Control>>, )
This method is the same as forward_canvas_draw_over_viewport, except it draws on top of everything. Useful when you need an extra layer that shows over anything else.
You need to enable calling of this method by using set_force_draw_over_forwarding_enabled.
fn forward_3d_gui_input(
&mut self,
viewport_camera: Option<Gd<Camera3D>>,
event: Option<Gd<InputEvent>>,
) -> i32
fn forward_3d_gui_input( &mut self, viewport_camera: Option<Gd<Camera3D>>, event: Option<Gd<InputEvent>>, ) -> i32
Called when there is a root node in the current edited scene, handles is implemented, and an InputEvent happens in the 3D viewport. The return value decides whether the InputEvent is consumed or forwarded to other EditorPlugins. See [enum AfterGUIInput] for options.
# Prevents the InputEvent from reaching other Editor classes.
func _forward_3d_gui_input(camera, event):
return EditorPlugin.AFTER_GUI_INPUT_STOPThis method must return AfterGuiInput::PASS in order to forward the InputEvent to other Editor classes.
# Consumes InputEventMouseMotion and forwards other InputEvent types.
func _forward_3d_gui_input(camera, event):
return EditorPlugin.AFTER_GUI_INPUT_STOP if event is InputEventMouseMotion else EditorPlugin.AFTER_GUI_INPUT_PASSfn forward_3d_draw_over_viewport(
&mut self,
viewport_control: Option<Gd<Control>>,
)
fn forward_3d_draw_over_viewport( &mut self, viewport_control: Option<Gd<Control>>, )
Called by the engine when the 3D editor’s viewport is updated. viewport_control is an overlay on top of the viewport and it can be used for drawing. You can update the viewport manually by calling update_overlays.
func _forward_3d_draw_over_viewport(overlay):
# Draw a circle at the cursor's position.
overlay.draw_circle(overlay.get_local_mouse_position(), 64, Color.WHITE)
func _forward_3d_gui_input(camera, event):
if event is InputEventMouseMotion:
# Redraw the viewport when the cursor is moved.
update_overlays()
return EditorPlugin.AFTER_GUI_INPUT_STOP
return EditorPlugin.AFTER_GUI_INPUT_PASSfn forward_3d_force_draw_over_viewport(
&mut self,
viewport_control: Option<Gd<Control>>,
)
fn forward_3d_force_draw_over_viewport( &mut self, viewport_control: Option<Gd<Control>>, )
This method is the same as forward_3d_draw_over_viewport, except it draws on top of everything. Useful when you need an extra layer that shows over anything else.
You need to enable calling of this method by using set_force_draw_over_forwarding_enabled.
fn get_plugin_name(&self) -> GString
fn get_plugin_name(&self) -> GString
Override this method in your plugin to provide the name of the plugin when displayed in the Godot editor.
For main screen plugins, this appears at the top of the screen, to the right of the “2D”, “3D”, “Script”, “Game”, and “AssetLib” buttons.
fn get_plugin_icon(&self) -> Option<Gd<Texture2D>>
fn get_plugin_icon(&self) -> Option<Gd<Texture2D>>
Override this method in your plugin to return a Texture2D in order to give it an icon.
For main screen plugins, this appears at the top of the screen, to the right of the “2D”, “3D”, “Script”, “Game”, and “AssetLib” buttons.
Ideally, the plugin icon should be white with a transparent background and 16×16 pixels in size.
func _get_plugin_icon():
# You can use a custom icon:
return preload("res://addons/my_plugin/my_plugin_icon.svg")
# Or use a built-in icon:
return EditorInterface.get_editor_theme().get_icon("Node", "EditorIcons")fn has_main_screen(&self) -> bool
fn has_main_screen(&self) -> bool
Returns true if this is a main screen editor plugin (it goes in the workspace selector together with 2D, 3D, Script, Game, and AssetLib).
When the plugin’s workspace is selected, other main screen plugins will be hidden, but your plugin will not appear automatically. It needs to be added as a child of get_editor_main_screen and made visible inside make_visible.
Use get_plugin_name and get_plugin_icon to customize the plugin button’s appearance.
var plugin_control
func _enter_tree():
plugin_control = preload("my_plugin_control.tscn").instantiate()
EditorInterface.get_editor_main_screen().add_child(plugin_control)
plugin_control.hide()
func _has_main_screen():
return true
func _make_visible(visible):
plugin_control.visible = visible
func _get_plugin_name():
return "My Super Cool Plugin 3000"
func _get_plugin_icon():
return EditorInterface.get_editor_theme().get_icon("Node", "EditorIcons")fn make_visible(&mut self, visible: bool)
fn make_visible(&mut self, visible: bool)
This function will be called when the editor is requested to become visible. It is used for plugins that edit a specific object type.
Remember that you have to manage the visibility of all your editor controls manually.
fn edit(&mut self, object: Option<Gd<Object>>)
fn edit(&mut self, object: Option<Gd<Object>>)
This function is used for plugins that edit specific object types (nodes or resources). It requests the editor to edit the given object.
object can be null if the plugin was editing an object, but there is no longer any selected object handled by this plugin. It can be used to cleanup editing state.
fn handles(&self, object: Gd<Object>) -> bool
fn handles(&self, object: Gd<Object>) -> bool
Implement this function if your plugin edits a specific type of object (Resource or Node). If you return true, then you will get the functions edit and make_visible called when the editor requests them. If you have declared the methods forward_canvas_gui_input and forward_3d_gui_input these will be called too.
Note: Each plugin should handle only one type of objects at a time. If a plugin handles more types of objects and they are edited at the same time, it will result in errors.
fn get_state(&self) -> AnyDictionary
fn get_state(&self) -> AnyDictionary
Override this method to provide a state data you want to be saved, like view position, grid settings, folding, etc. This is used when saving the scene (so state is kept when opening it again) and for switching tabs (so state can be restored when the tab returns). This data is automatically saved for each scene in an editstate file in the editor metadata folder. If you want to store global (scene-independent) editor data for your plugin, you can use get_window_layout instead.
Use set_state to restore your saved state.
Note: This method should not be used to save important settings that should persist with the project.
Note: You must implement get_plugin_name for the state to be stored and restored correctly.
func _get_state():
var state = { "zoom": zoom, "preferred_color": my_color }
return statefn set_state(&mut self, state: Dictionary<Variant, Variant>)
fn set_state(&mut self, state: Dictionary<Variant, Variant>)
Restore the state saved by get_state. This method is called when the current scene tab is changed in the editor.
Note: Your plugin must implement get_plugin_name, otherwise it will not be recognized and this method will not be called.
func _set_state(data):
zoom = data.get("zoom", 1.0)
preferred_color = data.get("my_color", Color.WHITE)fn clear(&mut self)
fn clear(&mut self)
Clear all the state and reset the object being edited to zero. This ensures your plugin does not keep editing a currently existing node, or a node from the wrong scene.
fn get_unsaved_status(&self, for_scene: GString) -> GString
fn get_unsaved_status(&self, for_scene: GString) -> GString
Override this method to provide a custom message that lists unsaved changes. The editor will call this method when exiting or when closing a scene, and display the returned string in a confirmation dialog. Return empty string if the plugin has no unsaved changes.
When closing a scene, for_scene is the path to the scene being closed. You can use it to handle built-in resources in that scene.
If the user confirms saving, save_external_data will be called, before closing the editor.
func _get_unsaved_status(for_scene):
if not unsaved:
return ""
if for_scene.is_empty():
return "Save changes in MyCustomPlugin before closing?"
else:
return "Scene %s has changes from MyCustomPlugin. Save before closing?" % for_scene.get_file()
func _save_external_data():
unsaved = falseIf the plugin has no scene-specific changes, you can ignore the calls when closing scenes:
func _get_unsaved_status(for_scene):
if not for_scene.is_empty():
return ""fn save_external_data(&mut self)
fn save_external_data(&mut self)
This method is called after the editor saves the project or when it’s closed. It asks the plugin to save edited external scenes/resources.
fn apply_changes(&mut self)
fn apply_changes(&mut self)
This method is called when the editor is about to save the project, switch to another tab, etc. It asks the plugin to apply any pending state changes to ensure consistency.
This is used, for example, in shader editors to let the plugin know that it must apply the shader code being written by the user to the object.
fn get_breakpoints(&self) -> PackedArray<GString>
fn get_breakpoints(&self) -> PackedArray<GString>
This is for editors that edit script-based objects. You can return a list of breakpoints in the format (script:line), for example: res://path_to_script.gd:25.
fn set_window_layout(&mut self, configuration: Option<Gd<ConfigFile>>)
fn set_window_layout(&mut self, configuration: Option<Gd<ConfigFile>>)
Restore the plugin GUI layout and data saved by get_window_layout. This method is called for every plugin on editor startup. Use the provided configuration file to read your saved data.
func _set_window_layout(configuration):
$Window.position = configuration.get_value("MyPlugin", "window_position", Vector2())
$Icon.modulate = configuration.get_value("MyPlugin", "icon_color", Color.WHITE)fn get_window_layout(&mut self, configuration: Option<Gd<ConfigFile>>)
fn get_window_layout(&mut self, configuration: Option<Gd<ConfigFile>>)
Override this method to provide the GUI layout of the plugin or any other data you want to be stored. This is used to save the project’s editor layout when queue_save_layout is called or the editor layout was changed (for example changing the position of a dock). The data is stored in the editor_layout.cfg file in the editor metadata directory.
Use set_window_layout to restore your saved layout.
func _get_window_layout(configuration):
configuration.set_value("MyPlugin", "window_position", $Window.position)
configuration.set_value("MyPlugin", "icon_color", $Icon.modulate)fn build(&mut self) -> bool
fn build(&mut self) -> bool
This method is called when the editor is about to run the project. The plugin can then perform required operations before the project runs.
This method must return a boolean. If this method returns false, the project will not run. The run is aborted immediately, so this also prevents all other plugins’ build methods from running.
fn run_scene(
&self,
scene: GString,
args: PackedArray<GString>,
) -> PackedArray<GString>
fn run_scene( &self, scene: GString, args: PackedArray<GString>, ) -> PackedArray<GString>
This function is called when an individual scene is about to be played in the editor. args is a list of command line arguments that will be passed to the new Godot instance, which will be replaced by the list returned by this function.
func _run_scene(scene, args):
args.append("--an-extra-argument")
return argsNote: Text that is printed in this method will not be visible in the editor’s Output panel unless [member EditorSettings.run/output/always_clear_output_on_play] is false.
fn enable_plugin(&mut self)
fn enable_plugin(&mut self)
Called by the engine when the user enables the EditorPlugin in the Plugin tab of the project settings window.
fn disable_plugin(&mut self)
fn disable_plugin(&mut self)
Called by the engine when the user disables the EditorPlugin in the Plugin tab of the project settings window.
fn get_configuration_warnings(&self) -> PackedArray<GString>
fn get_configuration_warnings(&self) -> PackedArray<GString>
The elements in the array returned from this method are displayed as warnings in the Scene dock if the script that overrides it is a tool script.
Returning an empty array produces no warnings.
Call update_configuration_warnings when the warnings need to be updated for this node.
@export var energy = 0:
set(value):
energy = value
update_configuration_warnings()
func _get_configuration_warnings():
if energy < 0:
return ["Energy must be 0 or greater."]
else:
return []fn get_accessibility_configuration_warnings(&self) -> PackedArray<GString>
fn get_accessibility_configuration_warnings(&self) -> PackedArray<GString>
The elements in the array returned from this method are displayed as warnings in the Scene dock if the script that overrides it is a tool script, and accessibility warnings are enabled in the editor settings.
Returning an empty array produces no warnings.
fn get_focused_accessibility_element(&self) -> Rid
fn get_focused_accessibility_element(&self) -> Rid
Called during accessibility information updates to determine the currently focused sub-element, should return a sub-element RID or the value returned by get_accessibility_element.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.