Button

Inherits: BaseButton < Control < CanvasItem < Node < Object

Inherited By: CheckBox, CheckButton, ColorPickerButton, MenuButton, OptionButton, ToolButton

Category: Core

Brief Description

Standard themed Button.

Properties

TextAlignalign
boolclip_text
boolflat
Textureicon
Stringtext

Theme Properties

StyleBoxdisabled
StyleBoxfocus
Fontfont
Colorfont_color
Colorfont_color_disabled
Colorfont_color_hover
Colorfont_color_pressed
StyleBoxhover
inthseparation
StyleBoxnormal
StyleBoxpressed

Enumerations

enum TextAlign:

  • ALIGN_LEFT = 0 — Align the text to the left.
  • ALIGN_CENTER = 1 — Align the text to the center.
  • ALIGN_RIGHT = 2 — Align the text to the right.

Description

Button is the standard themed button. It can contain text and an icon, and will display them according to the current Theme.

Property Descriptions

Setterset_text_align(value)
Getterget_text_align()

Text alignment policy for the button’s text, use one of the ALIGN_* constants.


Setterset_clip_text(value)
Getterget_clip_text()

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. This property is disabled by default.


Setterset_flat(value)
Getteris_flat()

Flat buttons don’t display decoration.


Setterset_button_icon(value)
Getterget_button_icon()

Button’s icon, if text is present the icon will be placed before the text.


Setterset_text(value)
Getterget_text()

The button’s text that will be displayed inside the button’s area.