Guide to the Godot game engine/Docks
Dock
editA dock is a side panel. Examples are Inspector
and Scene
.
First, to create a bottom panel, you need to make a UI for it:
- Create a scene and choose
User Interface
, and rename the root Control node todock
. - Save it inside your plugin folder, in the same place as the plugin script, under the name "dock.tscn".
- Select your Control, press
Layout
from the top of the screen, and pressFull Rect
from the drop down menu that appears. - With the Control still selected, expand
Rect
in the Inspector and changemin_size.x
to 60 (or some larger value) to ensure your UI appears with a non zero size. - Create the main UI as a child of the VBoxContainer.
Now, open your plugin's main script, and type the following code:
expands Control var dock: Control func _enter_tree(): # Put any load logic here, including adding new project settings dock = preload("dock.tscn").instance() func _exit_tree(): # Put exit tree logic here, including any saving remove_control_from_bottom_panel(dock) dock.queue_free()
- Getting started [ ]
- Making it work
- Making it look good
- Advanced help
- Miscellaneous