A library of custom components for Godot game engine.
Add the plugin as normal, and enable in project settings.
pip install -r requirements.txt
pre-commit install
All components are built internally using base Godot Control
nodes. This means components can be styled using their theme
property. Any cases where a component uses a CanvasLayer
internally (to pull it out of the parent layout, for things like overlapping UI elements), this is worked around by passing the theme to the root child(ren) of that CanvasLayer
when theme
changes.
Components are added to the "Create New Node" modal, so can be added right to your scene tree like other Control
nodes.
Allows you to provide a list of options, and have the user select them from a collapsible dropdown list.
Extends PanelContainer
.
options
: Array[String]
of selectable options. Shown when the input is expanded.
option_scene
: Path || null
is load
ed when set, if not null
. Allows for customizing how options are rendered. When set, option_scene
should be the path to a PackedScene
, and that scene should implement a text: String
property as well as a pressed
signal.
option_scroll_height
: float
height of scroll container for options, defaults to 100px.
expand_icon
: Texture2D
shown when the input is collapsed.
collapse_icon
: Texture2D
shown when the input is expanded.
button_custom_minimum_size
: Vector2
applied as a custom_minimum_size
for the root button component. Especially useful for controlling the minimum height.
selected_option
: String
is the option selected by the user, or set in code. Displayed as the text of the root button component.
option_selected(option: String)
: emitted when the user selects an option. Is not emitted when selected_option
is set in code.
PanelContainer
MarginContainer
VBoxContainer
HBoxContainer
Button
- the button the user clicks to expand the dropdown, also shows theselected_option
PanelContainer
CanvasLayer
- used so the dropdown is shown over other layout elements, instead of expanding the size of the root parentScrollContainer
- set to auto on vertical scroll, horizontal scroll off, defaults to 100px heightVBoxContainer
Button || option_scene
- one for eachoption
HSeparator
- one between eachoption
Like a single select, but allows the user to do case-insensitive search to filter options.
Extends PanelContainer
.
options
: Array[String]
of selectable options. Shown when the input is expanded.
option_scene
: Path || null
is load
ed when set, if not null
. Allows for customizing how options are rendered. When set, option_scene
should be the path to a PackedScene
, and that scene should implement a text: String
property as well as a pressed
signal.
expand_icon
: Texture2D
shown when the input is collapsed.
collapse_icon
: Texture2D
shown when the input is expanded.
search_custom_minimum_size
: Vector2
applied as a custom_minimum_size
for the root LineEdit
component. Especially useful for controlling the minimum height.
selected_option
: String
is the option selected by the user, or set in code. Displayed as the text of the root LineEdit
component.
option_selected(option: String)
: emitted when the user selects an option. Is not emitted when selected_option
is set in code.
PanelContainer
MarginContainer
VBoxContainer
HBoxContainer
LineEdit
- theLineEdit
the user focuses to expand the dropdown and filter options, also shows theselected_option
once one is selectedTextureRect
- used to display the expand/collapse icon
PanelContainer
CanvasLayer
- used so the dropdown is shown over other layout elements, instead of expanding the size of the root parentVBoxContainer
Button || option_scene
- one for eachoption
HSeparator
- one between eachoption