Skip to content

SBBaseButton

Nikita Yudin edited this page Feb 13, 2024 · 2 revisions

SBBaseButton icon SBBaseButton

Inherits: BaseButton

Inherited By: SBButton

Abstract base class for GUI SBButtons.

Description

Contains all the elements you need to build your buttons. It doesn't display anything by itself.

Properties

Let's look on list of all available properties:

Name Type Default Description
auto_initialize bool true Whether SpinButton should be initialised automatically when you create an instance. If disabled, then you need to auto_initialize it manually by calling method initialize. Note that the method init will work in any case.
auto_min_height bool true Whether the minimum button height should be auto calculated based on the title and content height.
expand_value bool true Whether the value should expand to fill the available space.
expand_value_min_size Vector2 Vector2.ZERO The minimum size for the value when member expand_value is false.

Methods

After we initialize we have its initialized instance in variable with helpful methods:

Name Return Description
initialize() void Initializes the SBBaseButton.
is_initialized() bool Checks if the SBBaseButton is initialized.
recalc_min_size() void Recalculates the minimum size.

Theme Properties

SpinButton comes with some theme properties that you apply for styling.

See Theme Module


Signals

SpinButton comes with a bunch of useful signals you can listen.

Name Description
button_disabled Emitted when a button is disabled.
button_enabled Emitted when a button is enabled.
button_initialized Emitted right after button initialization.
next_pressed Emitted when the next button is pressed.
prev_pressed Emitted when the prev button is pressed.
value_pressed Emitted when a value button is pressed.
left_icon_pressed Emitted when a left icon button is pressed.
right_icon_pressed Emitted when a right icon button is pressed.
content_pressed Emitted when the content button is pressed.