Button is the standard themed button. It can contain text and an icon, and it will display them according to the current Theme.
Example: Create a button and connect a method that will be called when the button is pressed:
See also BaseButton which contains common properties and methods associated with this node.
Text alignment policy for the button's text, use one of the HorizontalAlignment constants.
If set to something other than TextServer.AUTOWRAP_OFF, the text gets wrapped inside the node's bounding rectangle.
If true
, text that is too large to fit the button is clipped horizontally. If false
, the button will always be wide enough to hold the text. The text is not vertically clipped, and the button's height is not affected by this property.
When enabled, the button's icon will expand/shrink to fit the button's size while keeping its aspect. See also icon_max_width.
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 h_separation theme property and content_margin_*
properties of the used StyleBoxes.
Specifies if the icon should be aligned horizontally to the left, right, or center of a button. Uses the same HorizontalAlignment constants as the text alignment. If centered horizontally and vertically, text will draw on top of the icon.
Language code used for line-breaking and text shaping algorithms, if left empty current locale is used instead.
The button's text that will be displayed inside the button's area.
Base text writing direction.
Sets the clipping behavior when the text exceeds the node's bounding rectangle. See OverrunBehavior for a description of all modes.
Specifies if the icon should be aligned vertically to the top, bottom, or center of a button. Uses the same VerticalAlignment constants as the text alignment. If centered horizontally and vertically, text will draw on top of the icon.