Component with collapsible behavior to easily be attached to any UI needs. It takes two variables, the NodePath for a text element which will be handled to give feedback for collapsible options or state, and a NodePath for the node that must be toggled when collapsed.
If attached directly to a Button of any kind, it will auto connect with the “pressed” signal.
If this behavior is not desirable, just uncheck the option should_auto_connect
type | property | default value |
---|---|---|
NodePath | text_element_path | "" |
NodePath | collapsible_node_path | "" |
bool | should_auto_connect | True |
return type | method signature |
---|---|
null | toggle_collapse() |
null | handle_text() |
Default | "" |
NodePath for the feedback text.
Default | "" |
NodePath for the node that must be toggled on/off when collapsed.
Default | True |
Turn this off if you don’t want the component to try to auto connect with the pressed signal of the parent, in case the parent is a Button.
Will collapse/expand the target node, and also trigger a change in the text as additional feedback
Prepends a “+” to the text when the element is closed (collapsed) or a “-” when the element is visible (expanded).