reckfellENGINE

EditorPlugin

Used by the editor to extend its functionality.

On this page
class EditorPluginReckfellSharpEditorInherits Entity

Used by the editor to extend its functionality.

Plugins are used by the editor to extend functionality. The most common types of plugins are those which edit a given node or resource type, import plugins and export plugins. See also EditorScript to add functions to the editor. Note: Some names in this class contain "left" or "right" (e.g. EditorPlugin.DockSlot.LeftUl). These APIs assume left-to-right layout, and would be backwards when using right-to-left layout. These names are kept for compatibility reasons.

Declarations checked against C# SDK 1.0.0. Expand a name to see declarations and documentation.

Constructors1

EditorPluginConstructor
# EditorPlugin
C#
public EditorPlugin();

Methods78

AddAutoloadSingletonvoid
# AddAutoloadSingleton
C#
public void AddAutoloadSingleton(string name, string path);

Adds a script at path to the Autoload list as name.

Parameters
NameTypeDefault
namestring—
pathstring—
AddContextMenuPluginvoid
# AddContextMenuPlugin
C#
public void AddContextMenuPlugin(EditorContextMenuPlugin.ContextMenuSlot slot, EditorContextMenuPlugin plugin);

Adds a plugin to the context menu. slot is the context menu where the plugin will be added. Note: A plugin instance can belong only to a single context menu slot.

Parameters
NameTypeDefault
slotEditorContextMenuPlugin.ContextMenuSlot—
pluginEditorContextMenuPlugin—
AddControlToBottomPanel2 overloads · Includes deprecated
# AddControlToBottomPanel · 1/2
C#
public Button AddControlToBottomPanel(Control control, string title);

Adds a control to the bottom panel (together with Output, Debug, Animation, etc.). Returns a reference to a button that is outside the scene tree. It's up to you to hide/show the button when needed. When your plugin is deactivated, make sure to remove your custom control with EditorPlugin.RemoveControlFromBottomPanel and free it with Entity.QueueFree. shortcut is a shortcut that, when activated, will toggle the bottom panel's visibility. The shortcut object is only set when this control is added to the bottom panel. Note: See the default editor bottom panel shortcuts in the Editor Settings for inspiration. By convention, they all use the [kbd]Alt[/kbd] modifier.

Parameters
NameTypeDefault
controlControl—
titlestring—
Returns Button
# AddControlToBottomPanel · 2/2
C#
public Button AddControlToBottomPanel(Control control, string title, Shortcut shortcut = null);

Adds a control to the bottom panel (together with Output, Debug, Animation, etc.). Returns a reference to a button that is outside the scene tree. It's up to you to hide/show the button when needed. When your plugin is deactivated, make sure to remove your custom control with EditorPlugin.RemoveControlFromBottomPanel and free it with Entity.QueueFree. shortcut is a shortcut that, when activated, will toggle the bottom panel's visibility. The shortcut object is only set when this control is added to the bottom panel. Note: See the default editor bottom panel shortcuts in the Editor Settings for inspiration. By convention, they all use the [kbd]Alt[/kbd] modifier.

Parameters
NameTypeDefault
controlControl—
titlestring—
shortcutShortcutnull
Returns Button
AddControlToContainervoid
# AddControlToContainer
C#
public void AddControlToContainer(EditorPlugin.CustomControlContainer container, Control control);

Adds a custom control to a container in the editor UI. Please remember that you have to manage the visibility of your custom controls yourself (and likely hide it after adding it). When your plugin is deactivated, make sure to remove your custom control with EditorPlugin.RemoveControlFromContainer and free it with Entity.QueueFree.

Parameters
NameTypeDefault
containerEditorPlugin.CustomControlContainer—
controlControl—
AddControlToDock2 overloads · Includes deprecated
# AddControlToDock · 1/2
C#
public void AddControlToDock(EditorPlugin.DockSlot slot, Control control);

Adds the control to a specific dock slot. If the dock is repositioned and as long as the plugin is active, the editor will save the dock position on further sessions. When your plugin is deactivated, make sure to remove your custom control with EditorPlugin.RemoveControlFromDocks and free it with Entity.QueueFree. Optionally, you can specify a shortcut parameter. When pressed, this shortcut will open and focus the dock.

Parameters
NameTypeDefault
slotEditorPlugin.DockSlot—
controlControl—
# AddControlToDock · 2/2
C#
public void AddControlToDock(EditorPlugin.DockSlot slot, Control control, Shortcut shortcut = null);

Adds the control to a specific dock slot. If the dock is repositioned and as long as the plugin is active, the editor will save the dock position on further sessions. When your plugin is deactivated, make sure to remove your custom control with EditorPlugin.RemoveControlFromDocks and free it with Entity.QueueFree. Optionally, you can specify a shortcut parameter. When pressed, this shortcut will open and focus the dock.

Parameters
NameTypeDefault
slotEditorPlugin.DockSlot—
controlControl—
shortcutShortcutnull
AddCustomTypevoid
# AddCustomType
C#
public void AddCustomType(string type, string @base, Script script, Texture2D icon);

Adds a custom type, which will appear in the list of nodes or resources. When a given node or resource is selected, the base type will be instantiated (e.g. "Entity3D", "Control", "Resource"), then the script will be loaded and set to this object. Note: The base type is the base engine class which this type's class hierarchy inherits, not any custom type parent classes. You can use the virtual method EditorPlugin._Handles to check if your custom object is being edited by checking the script or using the is keyword. During run-time, this will be a simple object with a script so this function does not need to be called then. Note: Custom types added this way are not true classes. They are just a helper to create a node with specific script.

Parameters
NameTypeDefault
typestring—
basestring—
scriptScript—
iconTexture2D—
AddDebuggerPluginvoid
# AddDebuggerPlugin
C#
public void AddDebuggerPlugin(EditorDebuggerPlugin script);

Adds a Script as debugger plugin to the Debugger. The script must extend EditorDebuggerPlugin.

Parameters
NameTypeDefault
scriptEditorDebuggerPlugin—
AddDockvoid
# AddDock
C#
public void AddDock(EditorDock dock);

Registers an owned EditorDock with the editor dock manager. Set Title and DefaultSlot first; registering the same object twice is rejected. Disable by unregistering and freeing your panel.

Parameters
NameTypeDefault
dockEditorDock—
dock

Created EditorDock. The main-workspace example uses DefaultSlot=MainScreen.

AddEntity3DGizmoPluginvoid
# AddEntity3DGizmoPlugin
C#
public void AddEntity3DGizmoPlugin(EditorEntity3DGizmoPlugin plugin);

Register a 3D gizmo handler. Keep the instance for removal. In 1.0.0 registration does not guarantee rebuilding an already open scene's gizmos; save and reopen it when needed.

Parameters
NameTypeDefault
pluginEditorEntity3DGizmoPlugin—
plugin

The EditorEntity3DGizmoPlugin instance.

AddExportPlatformvoid
# AddExportPlatform
C#
public void AddExportPlatform(EditorExportPlatform platform);

Registers a new EditorExportPlatform. Export platforms provides functionality of exporting to the specific platform.

Parameters
NameTypeDefault
platformEditorExportPlatform—
AddExportPluginvoid
# AddExportPlugin
C#
public void AddExportPlugin(EditorExportPlugin plugin);

Registers a new EditorExportPlugin. Export plugins are used to perform tasks when the project is being exported. See EditorPlugin.AddInspectorPlugin for an example of how to register a plugin.

Parameters
NameTypeDefault
pluginEditorExportPlugin—
AddImportPluginvoid
# AddImportPlugin
C#
public void AddImportPlugin(EditorImportPlugin importer, bool firstPriority = false);

Register an editor resource importer. Keep its reference for removal when disabling the plugin. After the initial scan, registration schedules another scan through a deferred call.

Parameters
NameTypeDefault
importerEditorImportPlugin—
firstPriorityboolfalse
importer

The custom EditorImportPlugin instance.

firstPriority

Insert at the front of the registration list. Numerical _GetPriority() still participates in selection; false by default.

AddInspectorPluginvoid
# AddInspectorPlugin
C#
public void AddInspectorPlugin(EditorInspectorPlugin plugin);

Registers a ref-counted Inspector plugin. An already open object can need reparse/reselection: registration does not rebuild every existing property editor.

Parameters
NameTypeDefault
pluginEditorInspectorPlugin—
plugin

EditorInspectorPlugin instance later passed unchanged to RemoveInspectorPlugin.

AddResourceConversionPluginvoid
# AddResourceConversionPlugin
C#
public void AddResourceConversionPlugin(EditorResourceConversionPlugin plugin);

Registers a new EditorResourceConversionPlugin. Resource conversion plugins are used to add custom resource converters to the editor inspector. See EditorResourceConversionPlugin for an example of how to create a resource conversion plugin.

Parameters
NameTypeDefault
pluginEditorResourceConversionPlugin—
AddSceneFormatImporterPluginvoid
# AddSceneFormatImporterPlugin
C#
public void AddSceneFormatImporterPlugin(EditorSceneFormatImporter sceneFormatImporter, bool firstPriority = false);

Registers a new EditorSceneFormatImporter. Scene importers are used to import custom 3D asset formats as scenes. If first_priority is true, the new import plugin is inserted first in the list and takes precedence over pre-existing plugins.

Parameters
NameTypeDefault
sceneFormatImporterEditorSceneFormatImporter—
firstPriorityboolfalse
AddScenePostImportPluginvoid
# AddScenePostImportPlugin
C#
public void AddScenePostImportPlugin(EditorScenePostImportPlugin sceneImportPlugin, bool firstPriority = false);

Add an EditorScenePostImportPlugin. These plugins allow customizing the import process of 3D assets by adding new options to the import dialogs. If first_priority is true, the new import plugin is inserted first in the list and takes precedence over pre-existing plugins.

Parameters
NameTypeDefault
sceneImportPluginEditorScenePostImportPlugin—
firstPriorityboolfalse
AddToolMenuItemvoid
# AddToolMenuItem
C#
public void AddToolMenuItem(string name, Callable callable);

Adds a command to the project tools menu. Register once on plugin entry and remove on exit. Adding the same name again does not itself replace the previous item.

Parameters
NameTypeDefault
namestring—
callableCallable—
name

Item name later passed to RemoveToolMenuItem. Choose a sufficiently unique name.

callable

Command handler, such as Callable.From(InspectLevel). The example only reads the edited hierarchy.

AddToolSubmenuItemvoid
# AddToolSubmenuItem
C#
public void AddToolSubmenuItem(string name, PopupMenu submenu);

Adds a custom PopupMenu submenu under Project > Tools > name. Use EditorPlugin.RemoveToolMenuItem on plugin clean up to remove the menu.

Parameters
NameTypeDefault
namestring—
submenuPopupMenu—
AddTranslationParserPluginvoid
# AddTranslationParserPlugin
C#
public void AddTranslationParserPlugin(EditorTranslationParserPlugin parser);

Registers a custom translation parser plugin for extracting translatable strings from custom files.

Parameters
NameTypeDefault
parserEditorTranslationParserPlugin—
AddUndoRedoInspectorHookCallbackvoid
# AddUndoRedoInspectorHookCallback
C#
public void AddUndoRedoInspectorHookCallback(Callable callable);

Hooks a callback into the undo/redo action creation when a property is modified in the inspector. This allows, for example, to save other properties that may be lost when a given property is modified. The callback should have 4 arguments: ReckfellObject undo_redo, ReckfellObject modified_object, string property and Variant new_value. They are, respectively, the UndoRedo object used by the inspector, the currently modified object, the name of the modified property and the new value the property is about to take.

Parameters
NameTypeDefault
callableCallable—
GetEditorInterfaceEditorInterface · Deprecated
# GetEditorInterface
C#
public EditorInterface GetEditorInterface();

Returns the EditorInterface singleton instance.

Returns EditorInterface
GetExportAsMenuPopupMenu
# GetExportAsMenu
C#
public PopupMenu GetExportAsMenu();

Returns the PopupMenu under Scene > Export As....

Returns PopupMenu
GetPluginVersionstring
# GetPluginVersion
C#
public string GetPluginVersion();

Provide the version of the plugin declared in the plugin.cfg config file.

Returns string
GetScriptCreateDialogScriptCreateDialog
# GetScriptCreateDialog
C#
public ScriptCreateDialog GetScriptCreateDialog();

Gets the Editor's dialog used for making scripts. Note: Users can configure it before use. Warning: Removing and freeing this node will render a part of the editor useless and may cause a crash.

Returns ScriptCreateDialog
GetUndoRedoEditorUndoRedoManager
# GetUndoRedo
C#
public EditorUndoRedoManager GetUndoRedo();

Gets the undo/redo object. Most actions in the editor can be undoable, so use this object to make sure this happens when it's worth it.

Returns EditorUndoRedoManager
HideBottomPanelvoid
# HideBottomPanel
C#
public void HideBottomPanel();

Minimizes the bottom panel.

MakeBottomPanelItemVisiblevoid
# MakeBottomPanelItemVisible
C#
public void MakeBottomPanelItemVisible(Control item);

Makes a specific item in the bottom panel visible.

Parameters
NameTypeDefault
itemControl—
QueueSaveLayoutvoid
# QueueSaveLayout
C#
public void QueueSaveLayout();

Queue save the project's editor layout.

RemoveAutoloadSingletonvoid
# RemoveAutoloadSingleton
C#
public void RemoveAutoloadSingleton(string name);

Removes an Autoload name from the list.

Parameters
NameTypeDefault
namestring—
RemoveContextMenuPluginvoid
# RemoveContextMenuPlugin
C#
public void RemoveContextMenuPlugin(EditorContextMenuPlugin plugin);

Removes the specified context menu plugin.

Parameters
NameTypeDefault
pluginEditorContextMenuPlugin—
RemoveControlFromBottomPanelvoid · Deprecated
# RemoveControlFromBottomPanel
C#
public void RemoveControlFromBottomPanel(Control control);

Removes the control from the bottom panel. You have to manually Entity.QueueFree the control.

Parameters
NameTypeDefault
controlControl—
RemoveControlFromContainervoid
# RemoveControlFromContainer
C#
public void RemoveControlFromContainer(EditorPlugin.CustomControlContainer container, Control control);

Removes the control from the specified container. You have to manually Entity.QueueFree the control.

Parameters
NameTypeDefault
containerEditorPlugin.CustomControlContainer—
controlControl—
RemoveControlFromDocksvoid · Deprecated
# RemoveControlFromDocks
C#
public void RemoveControlFromDocks(Control control);

Removes the control from the dock. You have to manually Entity.QueueFree the control.

Parameters
NameTypeDefault
controlControl—
RemoveCustomTypevoid
# RemoveCustomType
C#
public void RemoveCustomType(string type);

Removes a custom type added by EditorPlugin.AddCustomType.

Parameters
NameTypeDefault
typestring—
RemoveDebuggerPluginvoid
# RemoveDebuggerPlugin
C#
public void RemoveDebuggerPlugin(EditorDebuggerPlugin script);

Removes the debugger plugin with given script from the Debugger.

Parameters
NameTypeDefault
scriptEditorDebuggerPlugin—
RemoveDockvoid
# RemoveDock
C#
public void RemoveDock(EditorDock dock);

Unregisters a dock and detaches it from the manager. Does not free the object: separately QueueFree a plugin-owned panel.

Parameters
NameTypeDefault
dockEditorDock—
dock

The registered panel added by your plugin. Do not remove other extensions' panels.

RemoveEntity3DGizmoPluginvoid
# RemoveEntity3DGizmoPlugin
C#
public void RemoveEntity3DGizmoPlugin(EditorEntity3DGizmoPlugin plugin);

Unregister a handler. Pass the same instance, then release your owned reference. Do not delete user Entities.

Parameters
NameTypeDefault
pluginEditorEntity3DGizmoPlugin—
plugin

The previously registered handler.

RemoveExportPlatformvoid
# RemoveExportPlatform
C#
public void RemoveExportPlatform(EditorExportPlatform platform);

Removes an export platform registered by EditorPlugin.AddExportPlatform.

Parameters
NameTypeDefault
platformEditorExportPlatform—
RemoveExportPluginvoid
# RemoveExportPlugin
C#
public void RemoveExportPlugin(EditorExportPlugin plugin);

Removes an export plugin registered by EditorPlugin.AddExportPlugin.

Parameters
NameTypeDefault
pluginEditorExportPlugin—
RemoveImportPluginvoid
# RemoveImportPlugin
C#
public void RemoveImportPlugin(EditorImportPlugin importer);

Unregister a previously added importer. Then release your owned reference; do not delete user source files. An existing cache does not replace the importer when output must be rebuilt.

Parameters
NameTypeDefault
importerEditorImportPlugin—
importer

The same instance passed to AddImportPlugin().

RemoveInspectorPluginvoid
# RemoveInspectorPlugin
C#
public void RemoveInspectorPlugin(EditorInspectorPlugin plugin);

Unregisters an Inspector plugin. Does not promise to remove existing widgets from every Inspector; the example separately rebuilds its resource's main Inspector and releases its ref-counted reference.

Parameters
NameTypeDefault
pluginEditorInspectorPlugin—
plugin

The registered instance. Do not apply Entity QueueFree to a ref-counted plugin.

RemoveResourceConversionPluginvoid
# RemoveResourceConversionPlugin
C#
public void RemoveResourceConversionPlugin(EditorResourceConversionPlugin plugin);

Removes a resource conversion plugin registered by EditorPlugin.AddResourceConversionPlugin.

Parameters
NameTypeDefault
pluginEditorResourceConversionPlugin—
RemoveSceneFormatImporterPluginvoid
# RemoveSceneFormatImporterPlugin
C#
public void RemoveSceneFormatImporterPlugin(EditorSceneFormatImporter sceneFormatImporter);

Removes a scene format importer registered by EditorPlugin.AddSceneFormatImporterPlugin.

Parameters
NameTypeDefault
sceneFormatImporterEditorSceneFormatImporter—
RemoveScenePostImportPluginvoid
# RemoveScenePostImportPlugin
C#
public void RemoveScenePostImportPlugin(EditorScenePostImportPlugin sceneImportPlugin);

Remove the EditorScenePostImportPlugin, added with EditorPlugin.AddScenePostImportPlugin.

Parameters
NameTypeDefault
sceneImportPluginEditorScenePostImportPlugin—
RemoveToolMenuItemvoid
# RemoveToolMenuItem
C#
public void RemoveToolMenuItem(string name);

Removes a custom tools item by name. Call when disabling your plugin so reenablement leaves no old commands.

Parameters
NameTypeDefault
namestring—
name

The name supplied to AddToolMenuItem.

RemoveTranslationParserPluginvoid
# RemoveTranslationParserPlugin
C#
public void RemoveTranslationParserPlugin(EditorTranslationParserPlugin parser);

Removes a custom translation parser plugin registered by EditorPlugin.AddTranslationParserPlugin.

Parameters
NameTypeDefault
parserEditorTranslationParserPlugin—
RemoveUndoRedoInspectorHookCallbackvoid
# RemoveUndoRedoInspectorHookCallback
C#
public void RemoveUndoRedoInspectorHookCallback(Callable callable);

Removes a callback previously added by EditorPlugin.AddUndoRedoInspectorHookCallback.

Parameters
NameTypeDefault
callableCallable—
SetDockTabIconvoid · Deprecated
# SetDockTabIcon
C#
public void SetDockTabIcon(Control control, Texture2D icon);

Sets the tab icon for the given control in a dock slot. Setting to null removes the icon.

Parameters
NameTypeDefault
controlControl—
iconTexture2D—
SetForceDrawOverForwardingEnabledvoid
# SetForceDrawOverForwardingEnabled
C#
public void SetForceDrawOverForwardingEnabled();

Enables calling of EditorPlugin._ForwardCanvasForceDrawOverViewport for the 2D editor and EditorPlugin._Forward3DForceDrawOverViewport for the 3D editor when their viewports are updated. You need to call this method only once and it will work permanently for this plugin.

SetInputEventForwardingAlwaysEnabledvoid
# SetInputEventForwardingAlwaysEnabled
C#
public void SetInputEventForwardingAlwaysEnabled();

Use this method if you always want to receive inputs from 3D view screen inside EditorPlugin._Forward3DGuiInput. It might be especially usable if your plugin will want to use raycast in the scene.

UpdateOverlaysint
# UpdateOverlays
C#
public int UpdateOverlays();

Updates the overlays of the 2D and 3D editor viewport. Causes methods EditorPlugin._ForwardCanvasDrawOverViewport, EditorPlugin._ForwardCanvasForceDrawOverViewport, EditorPlugin._Forward3DDrawOverViewport and EditorPlugin._Forward3DForceDrawOverViewport to be called.

Returns int
_ApplyChangesvoid
# _ApplyChanges
C#
public virtual void _ApplyChanges();

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.

_Buildbool
# _Build
C#
public virtual bool _Build();

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' EditorPlugin._Build methods from running.

Returns bool
_Clearvoid
# _Clear
C#
public virtual void _Clear();

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.

_DisablePluginvoid
# _DisablePlugin
C#
public virtual void _DisablePlugin();

Called by the engine when the user disables the EditorPlugin in the Plugin tab of the project settings window.

_Editvoid
# _Edit
C#
public virtual void _Edit(ReckfellObject @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.

Parameters
NameTypeDefault
objectReckfellObject—
_EnablePluginvoid
# _EnablePlugin
C#
public virtual void _EnablePlugin();

Called by the engine when the user enables the EditorPlugin in the Plugin tab of the project settings window.

_Forward3DDrawOverViewportvoid
# _Forward3DDrawOverViewport
C#
public virtual void _Forward3DDrawOverViewport(Control viewportControl);

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 EditorPlugin.UpdateOverlays.

C#
public override void _Forward3DDrawOverViewport(Control viewportControl)
{
    // Draw a circle at the cursor's position.
    viewportControl.DrawCircle(viewportControl.GetLocalMousePosition(), 64, Colors.White);
}

public override EditorPlugin.AfterGuiInput _Forward3DGuiInput(Camera3D viewportCamera, InputEvent @event)
{
    if (@event is InputEventMouseMotion)
    {
        // Redraw the viewport when the cursor is moved.
        UpdateOverlays();
        return EditorPlugin.AfterGuiInput.Stop;
    }
    return EditorPlugin.AfterGuiInput.Pass;
}
Parameters
NameTypeDefault
viewportControlControl—
_Forward3DForceDrawOverViewportvoid
# _Forward3DForceDrawOverViewport
C#
public virtual void _Forward3DForceDrawOverViewport(Control viewportControl);

This method is the same as EditorPlugin._Forward3DDrawOverViewport, 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 EditorPlugin.SetForceDrawOverForwardingEnabled.

Parameters
NameTypeDefault
viewportControlControl—
_Forward3DGuiInputint
# _Forward3DGuiInput
C#
public virtual int _Forward3DGuiInput(Camera3D viewportCamera, InputEvent @event);

Called when there is a root node in the current edited scene, EditorPlugin._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 EditorPlugin.AfterGuiInput for options.

C#
// Prevents the InputEvent from reaching other Editor classes.
public override EditorPlugin.AfterGuiInput _Forward3DGuiInput(Camera3D camera, InputEvent @event)
{
    return EditorPlugin.AfterGuiInput.Stop;
}

This method must return EditorPlugin.AfterGuiInput.Pass in order to forward the InputEvent to other Editor classes.

C#
// Consumes InputEventMouseMotion and forwards other InputEvent types.
public override EditorPlugin.AfterGuiInput _Forward3DGuiInput(Camera3D camera, InputEvent @event)
{
    return @event is InputEventMouseMotion ? EditorPlugin.AfterGuiInput.Stop : EditorPlugin.AfterGuiInput.Pass;
}
Parameters
NameTypeDefault
viewportCameraCamera3D—
eventInputEvent—
Returns int
_ForwardCanvasDrawOverViewportvoid
# _ForwardCanvasDrawOverViewport
C#
public virtual void _ForwardCanvasDrawOverViewport(Control viewportControl);

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 EditorPlugin.UpdateOverlays.

C#
public override void _ForwardCanvasDrawOverViewport(Control viewportControl)
{
    // Draw a circle at the cursor's position.
    viewportControl.DrawCircle(viewportControl.GetLocalMousePosition(), 64, Colors.White);
}

public override bool _ForwardCanvasGuiInput(InputEvent @event)
{
    if (@event is InputEventMouseMotion)
    {
        // Redraw the viewport when the cursor is moved.
        UpdateOverlays();
        return true;
    }
    return false;
}
Parameters
NameTypeDefault
viewportControlControl—
_ForwardCanvasForceDrawOverViewportvoid
# _ForwardCanvasForceDrawOverViewport
C#
public virtual void _ForwardCanvasForceDrawOverViewport(Control viewportControl);

This method is the same as EditorPlugin._ForwardCanvasDrawOverViewport, 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 EditorPlugin.SetForceDrawOverForwardingEnabled.

Parameters
NameTypeDefault
viewportControlControl—
_ForwardCanvasGuiInputbool
# _ForwardCanvasGuiInput
C#
public virtual bool _ForwardCanvasGuiInput(InputEvent @event);

Called when there is a root node in the current edited scene, EditorPlugin._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.

C#
// Prevents the InputEvent from reaching other Editor classes.
public override bool ForwardCanvasGuiInput(InputEvent @event)
{
    return true;
}

This method must return false in order to forward the InputEvent to other Editor classes.

C#
// Consumes InputEventMouseMotion and forwards other InputEvent types.
public override bool _ForwardCanvasGuiInput(InputEvent @event)
{
    if (@event is InputEventMouseMotion)
    {
        return true;
    }
    return false;
}
Parameters
NameTypeDefault
eventInputEvent—
Returns bool
_GetBreakpointsstring[]
# _GetBreakpoints
C#
public virtual string[] _GetBreakpoints();

This is for editors that edit script-based objects. You can return a list of breakpoints in the format (script:line), for example: asset://path_to_script.cs:25.

Returns string[]
_GetPluginIconTexture2D · Deprecated
# _GetPluginIcon
C#
public virtual Texture2D _GetPluginIcon();

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 "Asset Store" buttons. Ideally, the plugin icon should be white with a transparent background and 16×16 pixels in size.

C#
public override Texture2D _GetPluginIcon()
{
    // You can use a custom icon:
    return ResourceLoader.Load<Texture2D>("asset://addons/my_plugin/my_plugin_icon.svg");
    // Or use a built-in icon:
    return EditorInterface.Singleton.GetEditorTheme().GetIcon("Entity", "EditorIcons");
}
Returns Texture2D
_GetPluginNamestring
# _GetPluginName
C#
public virtual string _GetPluginName();

Override this method in your plugin to provide the name of the plugin when displayed in the Reckfell editor. For main screen plugins, this appears at the top of the screen, to the right of the "2D", "3D", "Script", "Game", and "Asset Store" buttons. Note: Main screen plugins should instead use EditorDock.Title of a main screen dock.

Returns string
_GetStateReckfell.Collections.Dictionary
# _GetState
C#
public virtual Reckfell.Collections.Dictionary _GetState();

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 EditorPlugin._GetWindowLayout instead. Use EditorPlugin._SetState 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 EditorPlugin._GetPluginName for the state to be stored and restored correctly.

Returns Reckfell.Collections.Dictionary
_GetUnsavedStatusstring
# _GetUnsavedStatus
C#
public virtual string _GetUnsavedStatus(string forScene);

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, EditorPlugin._SaveExternalData will be called, before closing the editor.

If the plugin has no scene-specific changes, you can ignore the calls when closing scenes:

Parameters
NameTypeDefault
forScenestring—
Returns string
_GetWindowLayoutvoid
# _GetWindowLayout
C#
public virtual void _GetWindowLayout(ConfigFile configuration);

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 EditorPlugin.QueueSaveLayout 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 EditorPlugin._SetWindowLayout to restore your saved layout.

Parameters
NameTypeDefault
configurationConfigFile—
_Handlesbool
# _Handles
C#
public virtual bool _Handles(ReckfellObject @object);

Implement this function if your plugin edits a specific type of object (Resource or Entity). If you return true, then you will get the functions EditorPlugin._Edit and EditorPlugin._MakeVisible called when the editor requests them. If you have declared the methods EditorPlugin._ForwardCanvasGuiInput and EditorPlugin._Forward3DGuiInput 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.

Parameters
NameTypeDefault
objectReckfellObject—
Returns bool
_HasMainScreenbool · Deprecated
# _HasMainScreen
C#
public virtual bool _HasMainScreen();

Return true if this is a main screen editor plugin (it goes in the workspace selector together with 2D, 3D, Script, Game, and Asset Store). You can add a main screen dock by using EditorDock with EditorDock.DockLayout.MainScreen as available layout.

Returns bool
_MakeVisiblevoid
# _MakeVisible
C#
public virtual void _MakeVisible(bool visible);

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.

Parameters
NameTypeDefault
visiblebool—
_RunScenestring[]
# _RunScene
C#
public virtual string[] _RunScene(string scene, string[] args);

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 Reckfell instance, which will be replaced by the list returned by this function.

Note: Text that is printed in this method will not be visible in the editor's Output panel unless EditorSettings.run/output/always_clear_output_on_play is false.

Parameters
NameTypeDefault
scenestring—
argsstring[]—
Returns string[]
_SaveExternalDatavoid
# _SaveExternalData
C#
public virtual void _SaveExternalData();

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.

_SetStatevoid
# _SetState
C#
public virtual void _SetState(Reckfell.Collections.Dictionary state);

Restore the state saved by EditorPlugin._GetState. This method is called when the current scene tab is changed in the editor. Note: Your plugin must implement EditorPlugin._GetPluginName, otherwise it will not be recognized and this method will not be called.

Parameters
NameTypeDefault
stateReckfell.Collections.Dictionary—
_SetWindowLayoutvoid
# _SetWindowLayout
C#
public virtual void _SetWindowLayout(ConfigFile configuration);

Restore the plugin GUI layout and data saved by EditorPlugin._GetWindowLayout. This method is called for every plugin on editor startup. Use the provided configuration file to read your saved data.

Parameters
NameTypeDefault
configurationConfigFile—

Signals and events6

MainScreenChangedEvent
# MainScreenChanged
C#
public event EditorPlugin.MainScreenChangedEventHandler MainScreenChanged;

Emitted when user changes the workspace (2D, 3D, Script, Game, Asset Store). Also works with custom screens defined by plugins.

Handler parameters
NameTypeDefault
screenNamestring—
ProjectSettingsChangedEvent · Deprecated
# ProjectSettingsChanged
C#
public event Action ProjectSettingsChanged;

Emitted when any project setting has changed.

ResourceSavedEvent
# ResourceSaved
C#
public event EditorPlugin.ResourceSavedEventHandler ResourceSaved;

Emitted when the given resource was saved on disc. See also EditorPlugin.SceneSaved.

Handler parameters
NameTypeDefault
resourceResource—
SceneChangedEvent
# SceneChanged
C#
public event EditorPlugin.SceneChangedEventHandler SceneChanged;

Emitted when the scene is changed in the editor. The argument will return the root node of the scene that has just become active. If this scene is new and empty, the argument will be null.

Handler parameters
NameTypeDefault
sceneRootEntity—
SceneClosedEvent
# SceneClosed
C#
public event EditorPlugin.SceneClosedEventHandler SceneClosed;

Emitted when user closes a scene. The argument is a file path to the closed scene.

Handler parameters
NameTypeDefault
filepathstring—
SceneSavedEvent
# SceneSaved
C#
public event EditorPlugin.SceneSavedEventHandler SceneSaved;

Emitted when a scene was saved on disc. The argument is a file path to the saved scene. See also EditorPlugin.ResourceSaved.

Handler parameters
NameTypeDefault
filepathstring—

EditorPlugin.AfterGuiInput

ValueDescription
Custom = 2

Pass the InputEvent to other editor plugins except the main Entity3D one. This can be used to prevent node selection changes and work with sub-gizmos instead.

Pass = 0

Forwards the InputEvent to other EditorPlugins.

Stop = 1

Prevents the InputEvent from reaching other Editor classes.

EditorPlugin.CustomControlContainer

ValueDescription
CanvasEditorBottom = 8

Bottom panel of the 2D editor.

CanvasEditorMenu = 5

The toolbar that appears when 2D editor is active.

CanvasEditorSideLeft = 6

Left sidebar of the 2D editor.

CanvasEditorSideRight = 7

Right sidebar of the 2D editor.

InspectorBottom = 9

Bottom section of the inspector.

ProjectSettingTabLeft = 10

Tab of Project Settings dialog, to the left of other tabs.

ProjectSettingTabRight = 11

Tab of Project Settings dialog, to the right of other tabs.

SpatialEditorBottom = 4

Bottom panel of the 3D editor.

SpatialEditorMenu = 1

The toolbar that appears when 3D editor is active.

SpatialEditorSideLeft = 2

Left sidebar of the 3D editor.

SpatialEditorSideRight = 3

Right sidebar of the 3D editor.

Toolbar = 0

Main editor toolbar, next to play buttons.

EditorPlugin.DockSlot

ValueDescription
Bottom = 8

Bottom panel.

LeftBl = 1

Dock slot, left side, bottom-left (empty in default layout).

LeftBr = 3

Dock slot, left side, bottom-right (in default layout includes Content Browser).

LeftUl = 0

Dock slot, left side, upper-left (empty in default layout).

LeftUr = 2

Dock slot, left side, upper-right (in default layout includes Scene and Import docks).

Max = 9

Represents the size of the EditorPlugin.DockSlot enum.

None = -1

The dock is closed.

RightBl = 5

Dock slot, right side, bottom-left (empty in default layout).

RightBr = 7

Dock slot, right side, bottom-right (empty in default layout).

RightUl = 4

Dock slot, right side, upper-left (in default layout includes Inspector, Entity, and History docks).

RightUr = 6

Dock slot, right side, upper-right (empty in default layout).

Reckfell Engine documentationBack to top ↑
QUICK LINKSGetting startedEntity hierarchyC# & .NET 10Scenes and prefabs
Reckfell guides and full API K
reckfellENGINE
RECKFELL ACCOUNT

Sign in

Sign in to your Reckfell account.

One account for the entire Reckfell platform.