class-description NEWS COMMUNITY STORE TUTORIALS SIGN UP LOGIN LOGOUT ROKOJORI NEWSLETTER SIGN UP LOGIN LOGOUT NEWS COMMUNITY STORE TUTORIALS TOGGLE FULLSCREEN VOLLBILD AN/AUS ObjectNodeCanvasItemControlContainerMarginContainer EditorDock
Dockable container for the editor.
EditorDock is a 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 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 [method 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 = EditorDock.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
Enum DockLayout<>():Enum

DOCK_LAYOUT_VERTICAL:null = 1
Allows placing the dock in the vertical dock slots on either side of the editor.


DOCK_LAYOUT_HORIZONTAL:null = 2
Allows placing the dock in the horizontal dock slots at the bottom.


DOCK_LAYOUT_FLOATING:null = 4
Allows making the dock floating (opened as a separate window).


DOCK_LAYOUT_ALL:null = 7
Allows placing the dock in all available slots.
Enum DockSlot<>():Enum

DOCK_SLOT_NONE:null = -1
The dock is closed.


DOCK_SLOT_LEFT_UL:null = 0
Dock slot, left side, upper-left (empty in default layout).


DOCK_SLOT_LEFT_BL:null = 1
Dock slot, left side, bottom-left (empty in default layout).


DOCK_SLOT_LEFT_UR:null = 2
Dock slot, left side, upper-right (in default layout includes Scene and Import docks).


DOCK_SLOT_LEFT_BR:null = 3
Dock slot, left side, bottom-right (in default layout includes FileSystem and History docks).


DOCK_SLOT_RIGHT_UL:null = 4
Dock slot, right side, upper-left (in default layout includes Inspector, Signal, and Group docks).


DOCK_SLOT_RIGHT_BL:null = 5
Dock slot, right side, bottom-left (empty in default layout).


DOCK_SLOT_RIGHT_UR:null = 6
Dock slot, right side, upper-right (empty in default layout).


DOCK_SLOT_RIGHT_BR:null = 7
Dock slot, right side, bottom-right (empty in default layout).


DOCK_SLOT_BOTTOM:null = 8
Bottom panel.


DOCK_SLOT_BOTTOM_L:null = 9
Dock slot at the bottom, below bottom panel, on the left side.


DOCK_SLOT_BOTTOM_R:null = 10
Dock slot at the bottom, below bottom panel, on the right side.


DOCK_SLOT_MAX:null = 11
Represents the size of the DockSlot enum.
Signal closed<>():Signal
Emitted when the dock is closed with the Close button in the context popup, before it's removed from its parent. See closable.

Signal opened<>():Signal
Emitted when the dock is opened via the Editor > Editor Docks menu, before it's made visible.

set get bool accessibility_region<>():bool set get
set get int available_layouts<>():int set get
The available layouts for this dock, as a bitmask. By default, the dock allows vertical and floating layouts.

set get bool closable<>():bool set get
If true, the dock can be closed with the Close button in the context popup. Docks with global enabled are always closable.

set get int default_slot<>():int set get
The default dock slot used when adding the dock with [method 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.
set get Texture2D dock_icon<>():Texture2D set get
The icon for the dock, as a texture. If specified, it will override icon_name.

set get Shortcut dock_shortcut<>():Shortcut set get
The shortcut used to open the dock.

set get bool force_show_icon<>():bool set get
If true, the dock will always display an icon, regardless of [member EditorSettings.interface/editor/docks/dock_tab_style] or [member EditorSettings.interface/editor/docks/bottom_dock_tab_style].

set get bool global<>():bool set get
If true, the dock appears in the Editor > Editor Docks menu and can be closed. Non-global docks can still be closed using close or when closable is true.

set get StringName icon_name<>():StringName set get
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 [url=https://godot-editor-icons.github.io/]here[/url].

set get String layout_key<>():String set get
The key representing this dock in the editor's layout file. If empty, the dock's displayed name will be used instead.

set get String title<>():String set get
The title of the dock's tab. If empty, the dock's [member Node.name] will be used. If the name is auto-generated (contains @), the first child's name will be used instead.

set get Color title_color<>():Color set get
The color of the dock tab's title. If its alpha is 0.0, the default font color will be used.

set get bool transient<>():bool set get
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 TileMap or AnimationTree node.

void _load_layout_from_config<>( ConfigFile config=, config:ConfigFile=, String section=, section:String=, ):void
Implement this method to handle loading this dock's layout. It's equivalent to [method EditorPlugin._set_window_layout]. section is a unique section based on layout_key.

void _save_layout_to_config<>( ConfigFile config=, config:ConfigFile=, String section=, section:String=, ):void
Implement this method to handle saving this dock's layout. It's equivalent to [method EditorPlugin._get_window_layout]. section is a unique section based on layout_key.

void _update_layout<>( int layout=, layout:int=, ):void
Implement this method to handle the layout switching for this dock. layout is one of the DockLayout constants.

func _update_layout(layout): box_container.vertical = (layout == DOCK_LAYOUT_VERTICAL)
void close<>():void
Closes the dock, making its tab hidden.

void make_visible<>():void
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.

void open<>():void
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 make_visible.



All social media brands are registrated trademarks and belong to their respective owners.





CONTACT IMPRINT TERMS OF USE PRIVACY © ROKOROJI ® 2021 rokojori.com
CONTACT IMPRINT TERMS OF USE PRIVACY © ROKOROJI ® 2021 rokojori.com
We are using cookies on this site. Read more... Wir benutzen Cookies auf dieser Seite. Mehr lesen...