Button
The Button GUI Object is a simple icon to attach Logic to. It can be configured so that something occurs when it is clicked in tandem with using the Mouse Nodes. A Button's text, placement, and size can be altered using the Attributes.


Attributes
The Object's Attributes can be used to fully customize the Object. Explained below, they are:
Transformation

The Transformation Attributes deal with placement, rotation, and size in XY space. More information can be found here.
Text
The Text Attributes customize the textual elements of a Button.
There are two ways the Text Attribute can be incorporated in the Object. That is either as Static Text or Translation. This can be switched using the text or translation icons to the right, in that order.

Static Text

When Static Text is selected, the Attributes are:
Textis the text itself which will be displayed on the Button. Please note that only text which fits within the confines of the Button will be displayed. Size the Button accordingly.Colordecides the color of the Button's text.Transformcan easily change certain text aesthetics without requiring the user to change theTextAttribute itself.Capitalizemakes the first letter capital,uppercasemakes all letters capital, andlowercasemakes all letters lowercase.
Translation

When Translation is selected, the Attributes are:
Translationlets the user choose the key of the current language (which is established in the Project Settings). In the image above, the selected key isphrase.Colordecides the color of the Button's translation.Transformcan easily change certain text aesthetics without requiring the user to change theTranslationAttribute itself.Capitalizemakes the first letter capital,uppercasemakes all letters capital, andlowercasemakes all letters lowercase.
Font

The Font Attributes focus on the details of the Button's text. Please note that while Buttons are capable of handling variable fonts, only the default style will be used, as the configurable Attributes are not available for this Object.
Familyoffers two different font types:ManropeandSource Code Pro. More fonts can be added by the user in Project Settings.Sizedetermines the size of the font in pixels.
Style

The Style Attributes allow for more customizability. This can override any stylesheet provided in the Project Settings or a Scene2D.
To address these in the Logic, please refer to the Object 2D Nodes.
Background Colordetermines the color of the Button itself. In the example image above, it is green.Border Radius (px)decides to what extent the corners and edges of the Button are rounded.CSS Classescontain the CSS class names of the Object.Stylesheetcontains the CSS stylesheet of the Object.
Tag

This Attribute manages the tags for the Button. See more on tags here.
Last updated
Was this helpful?