Standard themed Button.
Button is the standard themed button. It can contain text and an icon, and will display them according to the current [Theme]. [b]Example of creating a button and assigning an action when pressed by code:[/b] [codeblock] func _ready(): var button = Button.new() button.text = "Click me" button.connect("pressed", self, "_button_pressed") add_child(button)

func _button_pressed(): print("Hello world!") [/codeblock] Buttons (like all Control nodes) can also be created in the editor, but some situations may require creating them from code. See also [BaseButton] which contains common properties and methods associated with this node. [b]Note:[/b] Buttons do not interpret touch input and therefore don't support multitouch, since mouse emulation can only press one button at a given time. Use [TouchScreenButton] for buttons that trigger gameplay movement or actions, as [TouchScreenButton] supports multitouch.
https://godotengine.org/asset-library/asset/515 https://godotengine.org/asset-library/asset/677
- Text alignment policy for the button's text, use one of the [enum TextAlign] constants.
- When this property is enabled, text that is too large to fit the button is clipped, when disabled the Button will always be wide enough to hold the text.
- When enabled, the button's icon will expand/shrink to fit the button's size while keeping its aspect.
- Flat buttons don't display decoration.
- Button's icon, if text is present the icon will be placed before the text. To edit margin and spacing of the icon, use [code]hseparation[/code] theme property of [Button] and [code]content_margin_*[/code] properties of the used [StyleBox]es.
- Specifies if the icon should be aligned to the left, right, or center of a button. Uses the same [enum TextAlign] constants as the text alignment. If centered, text will draw on top of the icon.
- The button's text that will be displayed inside the button's area.
Align the text to the left.
Align the text to the center.
Align the text to the right.
Default text [Color] of the [Button].
Text [Color] used when the [Button] is disabled.
Text [Color] used when the [Button] is focused. Only replaces the normal text color of the button. Disabled, hovered, and pressed states take precedence over this color.
Text [Color] used when the [Button] is being hovered.
Text [Color] used when the [Button] is being hovered and pressed.
Text [Color] used when the [Button] is being pressed.
Icon modulate [Color] used when the [Button] is disabled.
Icon modulate [Color] used when the [Button] is focused. Only replaces the normal modulate color of the button. Disabled, hovered, and pressed states take precedence over this color.
Icon modulate [Color] used when the [Button] is being hovered.
Icon modulate [Color] used when the [Button] is being hovered and pressed.
Default icon modulate [Color] of the [Button].
Icon modulate [Color] used when the [Button] is being pressed.
The horizontal space between [Button]'s icon and text.
[Font] of the [Button]'s text.
[StyleBox] used when the [Button] is disabled.
[StyleBox] used when the [Button] is focused. It is displayed over the current [StyleBox], so using [StyleBoxEmpty] will just disable the focus visual effect.
[StyleBox] used when the [Button] is being hovered.
Default [StyleBox] for the [Button].
[StyleBox] used when the [Button] is being pressed.