:github_url: hide .. DO NOT EDIT THIS FILE!!! .. Generated automatically from Godot engine sources. .. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py. .. XML source: https://github.com/godotengine/godot/tree/master/doc/classes/EditorDock.xml. .. _class_EditorDock: EditorDock ========== **Experimental:** This class may be changed or removed in future versions. **Inherits:** :ref:`MarginContainer` **<** :ref:`Container` **<** :ref:`Control` **<** :ref:`CanvasItem` **<** :ref:`Node` **<** :ref:`Object` **Inherited By:** :ref:`FileSystemDock` Dockable container for the editor. .. rst-class:: classref-introduction-group Description ----------- EditorDock is a :ref:`Container` node that can be docked in one of the editor's dock slots. Docks are added by plugins to provide space for controls related to an :ref:`EditorPlugin`. The editor comes with a few built-in docks, such as the Scene dock, FileSystem dock, etc. You can add a dock by using :ref:`EditorPlugin.add_dock()`. The dock can be customized by changing its properties. :: @tool extends EditorPlugin # Dock reference. var dock # Plugin initialization. func _enter_tree(): dock = EditorDock.new() dock.title = "My Dock" dock.dock_icon = preload("./dock_icon.png") dock.default_slot = EditorPlugin.DOCK_SLOT_RIGHT_UL var dock_content = preload("./dock_content.tscn").instantiate() dock.add_child(dock_content) add_dock(dock) # Plugin clean-up. func _exit_tree(): remove_dock(dock) dock.queue_free() dock = null .. rst-class:: classref-introduction-group Tutorials --------- - :doc:`Making plugins <../tutorials/plugins/editor/making_plugins>` .. rst-class:: classref-reftable-group Properties ---------- .. table:: :widths: auto +-------------------------------------------------------------+-----------------------------------------------------------------------+---------------------------------------------------------------------------+ | |bitfield|\[:ref:`DockLayout`\] | :ref:`available_layouts` | ``1`` | +-------------------------------------------------------------+-----------------------------------------------------------------------+---------------------------------------------------------------------------+ | :ref:`bool` | clip_contents | ``true`` (overrides :ref:`Control`) | +-------------------------------------------------------------+-----------------------------------------------------------------------+---------------------------------------------------------------------------+ | :ref:`DockSlot` | :ref:`default_slot` | ``-1`` | +-------------------------------------------------------------+-----------------------------------------------------------------------+---------------------------------------------------------------------------+ | :ref:`Texture2D` | :ref:`dock_icon` | | +-------------------------------------------------------------+-----------------------------------------------------------------------+---------------------------------------------------------------------------+ | :ref:`Shortcut` | :ref:`dock_shortcut` | | +-------------------------------------------------------------+-----------------------------------------------------------------------+---------------------------------------------------------------------------+ | :ref:`StringName` | :ref:`icon_name` | ``&""`` | +-------------------------------------------------------------+-----------------------------------------------------------------------+---------------------------------------------------------------------------+ | :ref:`String` | :ref:`layout_key` | ``""`` | +-------------------------------------------------------------+-----------------------------------------------------------------------+---------------------------------------------------------------------------+ | :ref:`String` | :ref:`title` | ``""`` | +-------------------------------------------------------------+-----------------------------------------------------------------------+---------------------------------------------------------------------------+ .. rst-class:: classref-reftable-group Methods ------- .. table:: :widths: auto +--------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | |void| | :ref:`_load_layout_from_config`\ (\ config\: :ref:`ConfigFile`, section\: :ref:`String`\ ) |virtual| | +--------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | |void| | :ref:`_save_layout_to_config`\ (\ config\: :ref:`ConfigFile`, section\: :ref:`String`\ ) |virtual| |const| | +--------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | |void| | :ref:`_update_layout`\ (\ layout\: :ref:`int`\ ) |virtual| | +--------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ .. rst-class:: classref-section-separator ---- .. rst-class:: classref-descriptions-group Enumerations ------------ .. _enum_EditorDock_DockLayout: .. rst-class:: classref-enumeration flags **DockLayout**: :ref:`🔗` .. _class_EditorDock_constant_DOCK_LAYOUT_VERTICAL: .. rst-class:: classref-enumeration-constant :ref:`DockLayout` **DOCK_LAYOUT_VERTICAL** = ``1`` Allows placing the dock in the vertical dock slots on either side of the editor. \ **Note:** Currently this flag has no effect because the bottom panel is not a proper dock slot. This means that the dock can always be vertical. .. _class_EditorDock_constant_DOCK_LAYOUT_HORIZONTAL: .. rst-class:: classref-enumeration-constant :ref:`DockLayout` **DOCK_LAYOUT_HORIZONTAL** = ``2`` Allows placing the dock in the editor's bottom panel. Implement :ref:`_update_layout()` to handle changing layouts. .. rst-class:: classref-section-separator ---- .. rst-class:: classref-descriptions-group Property Descriptions --------------------- .. _class_EditorDock_property_available_layouts: .. rst-class:: classref-property |bitfield|\[:ref:`DockLayout`\] **available_layouts** = ``1`` :ref:`🔗` .. rst-class:: classref-property-setget - |void| **set_available_layouts**\ (\ value\: |bitfield|\[:ref:`DockLayout`\]\ ) - |bitfield|\[:ref:`DockLayout`\] **get_available_layouts**\ (\ ) The available layouts for this dock, as a bitmask. If you want to make all layouts available, use ``available_layouts = DOCK_LAYOUT_VERTICAL | DOCK_LAYOUT_HORIZONTAL``. .. rst-class:: classref-item-separator ---- .. _class_EditorDock_property_default_slot: .. rst-class:: classref-property :ref:`DockSlot` **default_slot** = ``-1`` :ref:`🔗` .. rst-class:: classref-property-setget - |void| **set_default_slot**\ (\ value\: :ref:`DockSlot`\ ) - :ref:`DockSlot` **get_default_slot**\ (\ ) The default dock slot used when adding the dock with :ref:`EditorPlugin.add_dock()`. After the dock is added, it can be moved to a different slot and the editor will automatically remember its position between sessions. If you remove and re-add the dock, it will be reset to default. .. rst-class:: classref-item-separator ---- .. _class_EditorDock_property_dock_icon: .. rst-class:: classref-property :ref:`Texture2D` **dock_icon** :ref:`🔗` .. rst-class:: classref-property-setget - |void| **set_dock_icon**\ (\ value\: :ref:`Texture2D`\ ) - :ref:`Texture2D` **get_dock_icon**\ (\ ) The icon for the dock, as a texture. If specified, it will override :ref:`icon_name`. .. rst-class:: classref-item-separator ---- .. _class_EditorDock_property_dock_shortcut: .. rst-class:: classref-property :ref:`Shortcut` **dock_shortcut** :ref:`🔗` .. rst-class:: classref-property-setget - |void| **set_dock_shortcut**\ (\ value\: :ref:`Shortcut`\ ) - :ref:`Shortcut` **get_dock_shortcut**\ (\ ) The shortcut used to open the dock. This property can only be set before this dock is added via :ref:`EditorPlugin.add_dock()`. .. rst-class:: classref-item-separator ---- .. _class_EditorDock_property_icon_name: .. rst-class:: classref-property :ref:`StringName` **icon_name** = ``&""`` :ref:`🔗` .. rst-class:: classref-property-setget - |void| **set_icon_name**\ (\ value\: :ref:`StringName`\ ) - :ref:`StringName` **get_icon_name**\ (\ ) The icon for the dock, as a name from the ``EditorIcons`` theme type in the editor theme. You can find the list of available icons `here `__. .. rst-class:: classref-item-separator ---- .. _class_EditorDock_property_layout_key: .. rst-class:: classref-property :ref:`String` **layout_key** = ``""`` :ref:`🔗` .. rst-class:: classref-property-setget - |void| **set_layout_key**\ (\ value\: :ref:`String`\ ) - :ref:`String` **get_layout_key**\ (\ ) The key representing this dock in the editor's layout file. If empty, the dock's displayed name will be used instead. .. rst-class:: classref-item-separator ---- .. _class_EditorDock_property_title: .. rst-class:: classref-property :ref:`String` **title** = ``""`` :ref:`🔗` .. rst-class:: classref-property-setget - |void| **set_title**\ (\ value\: :ref:`String`\ ) - :ref:`String` **get_title**\ (\ ) The title of the dock's tab. If empty, the dock's :ref:`Node.name` will be used. If the name is auto-generated (contains ``@``), the first child's name will be used instead. .. rst-class:: classref-section-separator ---- .. rst-class:: classref-descriptions-group Method Descriptions ------------------- .. _class_EditorDock_private_method__load_layout_from_config: .. rst-class:: classref-method |void| **_load_layout_from_config**\ (\ config\: :ref:`ConfigFile`, section\: :ref:`String`\ ) |virtual| :ref:`🔗` Implement this method to handle loading this dock's layout. It's equivalent to :ref:`EditorPlugin._set_window_layout()`. ``section`` is a unique section based on :ref:`layout_key`. .. rst-class:: classref-item-separator ---- .. _class_EditorDock_private_method__save_layout_to_config: .. rst-class:: classref-method |void| **_save_layout_to_config**\ (\ config\: :ref:`ConfigFile`, section\: :ref:`String`\ ) |virtual| |const| :ref:`🔗` Implement this method to handle saving this dock's layout. It's equivalent to :ref:`EditorPlugin._get_window_layout()`. ``section`` is a unique section based on :ref:`layout_key`. .. rst-class:: classref-item-separator ---- .. _class_EditorDock_private_method__update_layout: .. rst-class:: classref-method |void| **_update_layout**\ (\ layout\: :ref:`int`\ ) |virtual| :ref:`🔗` Implement this method to handle the layout switching for this dock. ``layout`` is one of the :ref:`DockLayout` constants. :: _update_layout(layout): box_container.vertical = (layout == DOCK_LAYOUT_VERTICAL) .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)` .. |required| replace:: :abbr:`required (This method is required to be overridden when extending its base class.)` .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)` .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)` .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)` .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)` .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)` .. |bitfield| replace:: :abbr:`BitField (This value is an integer composed as a bitmask of the following flags.)` .. |void| replace:: :abbr:`void (No return value.)`