: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` | ``5`` | +-------------------------------------------------------------+-----------------------------------------------------------------------+-----------------------+ | :ref:`bool` | :ref:`closable` | ``false`` | +-------------------------------------------------------------+-----------------------------------------------------------------------+-----------------------+ | :ref:`DockSlot` | :ref:`default_slot` | ``-1`` | +-------------------------------------------------------------+-----------------------------------------------------------------------+-----------------------+ | :ref:`Texture2D` | :ref:`dock_icon` | | +-------------------------------------------------------------+-----------------------------------------------------------------------+-----------------------+ | :ref:`Shortcut` | :ref:`dock_shortcut` | | +-------------------------------------------------------------+-----------------------------------------------------------------------+-----------------------+ | :ref:`bool` | :ref:`force_show_icon` | ``false`` | +-------------------------------------------------------------+-----------------------------------------------------------------------+-----------------------+ | :ref:`bool` | :ref:`global` | ``true`` | +-------------------------------------------------------------+-----------------------------------------------------------------------+-----------------------+ | :ref:`StringName` | :ref:`icon_name` | ``&""`` | +-------------------------------------------------------------+-----------------------------------------------------------------------+-----------------------+ | :ref:`String` | :ref:`layout_key` | ``""`` | +-------------------------------------------------------------+-----------------------------------------------------------------------+-----------------------+ | :ref:`String` | :ref:`title` | ``""`` | +-------------------------------------------------------------+-----------------------------------------------------------------------+-----------------------+ | :ref:`Color` | :ref:`title_color` | ``Color(0, 0, 0, 0)`` | +-------------------------------------------------------------+-----------------------------------------------------------------------+-----------------------+ | :ref:`bool` | :ref:`transient` | ``false`` | +-------------------------------------------------------------+-----------------------------------------------------------------------+-----------------------+ .. 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| | +--------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | |void| | :ref:`close`\ (\ ) | +--------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | |void| | :ref:`make_visible`\ (\ ) | +--------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | |void| | :ref:`open`\ (\ ) | +--------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ .. rst-class:: classref-section-separator ---- .. rst-class:: classref-descriptions-group Signals ------- .. _class_EditorDock_signal_closed: .. rst-class:: classref-signal **closed**\ (\ ) :ref:`🔗` Emitted when the dock is closed with the Close button in the context popup, before it's removed from its parent. See :ref:`closable`. .. 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. .. _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. .. _class_EditorDock_constant_DOCK_LAYOUT_FLOATING: .. rst-class:: classref-enumeration-constant :ref:`DockLayout` **DOCK_LAYOUT_FLOATING** = ``4`` Allows making the dock floating (opened as a separate window). .. _class_EditorDock_constant_DOCK_LAYOUT_ALL: .. rst-class:: classref-enumeration-constant :ref:`DockLayout` **DOCK_LAYOUT_ALL** = ``7`` Allows placing the dock in all available slots. .. 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** = ``5`` :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. By default, the dock allows vertical and floating layouts. .. rst-class:: classref-item-separator ---- .. _class_EditorDock_property_closable: .. rst-class:: classref-property :ref:`bool` **closable** = ``false`` :ref:`🔗` .. rst-class:: classref-property-setget - |void| **set_closable**\ (\ value\: :ref:`bool`\ ) - :ref:`bool` **is_closable**\ (\ ) If ``true``, the dock can be closed with the Close button in the context popup. Docks with :ref:`global` enabled are always closable. .. 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. .. rst-class:: classref-item-separator ---- .. _class_EditorDock_property_force_show_icon: .. rst-class:: classref-property :ref:`bool` **force_show_icon** = ``false`` :ref:`🔗` .. rst-class:: classref-property-setget - |void| **set_force_show_icon**\ (\ value\: :ref:`bool`\ ) - :ref:`bool` **get_force_show_icon**\ (\ ) If ``true``, the dock will always display an icon, regardless of :ref:`EditorSettings.interface/editor/dock_tab_style` or :ref:`EditorSettings.interface/editor/bottom_dock_tab_style`. .. rst-class:: classref-item-separator ---- .. _class_EditorDock_property_global: .. rst-class:: classref-property :ref:`bool` **global** = ``true`` :ref:`🔗` .. rst-class:: classref-property-setget - |void| **set_global**\ (\ value\: :ref:`bool`\ ) - :ref:`bool` **is_global**\ (\ ) If ``true``, the dock appears in the **Editor > Editor Docks** menu and can be closed. Non-global docks can still be closed using :ref:`close()` or when :ref:`closable` is ``true``. .. 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-item-separator ---- .. _class_EditorDock_property_title_color: .. rst-class:: classref-property :ref:`Color` **title_color** = ``Color(0, 0, 0, 0)`` :ref:`🔗` .. rst-class:: classref-property-setget - |void| **set_title_color**\ (\ value\: :ref:`Color`\ ) - :ref:`Color` **get_title_color**\ (\ ) The color of the dock tab's title. If its alpha is ``0.0``, the default font color will be used. .. rst-class:: classref-item-separator ---- .. _class_EditorDock_property_transient: .. rst-class:: classref-property :ref:`bool` **transient** = ``false`` :ref:`🔗` .. rst-class:: classref-property-setget - |void| **set_transient**\ (\ value\: :ref:`bool`\ ) - :ref:`bool` **is_transient**\ (\ ) If ``true``, the dock is not automatically opened or closed when loading an editor layout, only moved. It also can't be opened using a shortcut. This is meant for docks that are opened and closed in specific cases, such as when selecting a :ref:`TileMap` or :ref:`AnimationTree` node. .. 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. :: func _update_layout(layout): box_container.vertical = (layout == DOCK_LAYOUT_VERTICAL) .. rst-class:: classref-item-separator ---- .. _class_EditorDock_method_close: .. rst-class:: classref-method |void| **close**\ (\ ) :ref:`🔗` Closes the dock, making its tab hidden. .. rst-class:: classref-item-separator ---- .. _class_EditorDock_method_make_visible: .. rst-class:: classref-method |void| **make_visible**\ (\ ) :ref:`🔗` Focuses the dock's tab (or window if it's floating). If the dock was closed, it will be opened. If it's a bottom dock, makes the bottom panel visible. .. rst-class:: classref-item-separator ---- .. _class_EditorDock_method_open: .. rst-class:: classref-method |void| **open**\ (\ ) :ref:`🔗` Opens the dock. It will appear in the last used dock slot. If the dock has no default slot, it will be opened floating. \ **Note:** This does not focus the dock. If you want to open and focus the dock, use :ref:`make_visible()`. .. |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.)`