class-description NEWS COMMUNITY STORE TUTORIALS SIGN UP LOGIN LOGOUT ROKOJORI NEWSLETTER SIGN UP LOGIN LOGOUT NEWS COMMUNITY STORE TUTORIALS TOGGLE FULLSCREEN VOLLBILD AN/AUS ObjectNodeCanvasItemControlBaseButton Button
A themed button that can contain text and an icon.

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:

func _ready(): var button = Button.new() button.text = "Click me" button.pressed.connect(_button_pressed) add_child(button) func _button_pressed(): print("Hello world!")

See also BaseButton which contains common properties and methods associated with this node.

HorizontalAlignment alignment<>():HorizontalAlignment

Text alignment policy for the button's text, use one of the HorizontalAlignment constants.

AutowrapMode autowrap_mode<>():AutowrapMode

If set to something other than TextServer.AUTOWRAP_OFF, the text gets wrapped inside the node's bounding rectangle.

bool clip_text<>():bool

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.

bool expand_icon<>():bool

When enabled, the button's icon will expand/shrink to fit the button's size while keeping its aspect. See also icon_max_width.

bool flat<>():bool

Flat buttons don't display decoration.

Texture2D icon<>():Texture2D

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.

HorizontalAlignment icon_alignment<>():HorizontalAlignment

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.

String language<>():String

Language code used for line-breaking and text shaping algorithms, if left empty current locale is used instead.

String text<>():String

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

TextDirection text_direction<>():TextDirection

Base text writing direction.

OverrunBehavior text_overrun_behavior<>():OverrunBehavior

Sets the clipping behavior when the text exceeds the node's bounding rectangle. See OverrunBehavior for a description of all modes.

VerticalAlignment vertical_icon_alignment<>():VerticalAlignment

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.




All social media brands are registrated trademarks and belong to their respective owners.





CONTACT IMPRINT TERMS OF USE PRIVACY © ROKOROJI ® 2021 rokojori.com
CONTACT IMPRINT TERMS OF USE PRIVACY © ROKOROJI ® 2021 rokojori.com
We are using cookies on this site. Read more... Wir benutzen Cookies auf dieser Seite. Mehr lesen...