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.
![](https://docs.incari.com/~gitbook/image?url=https%3A%2F%2F2628349686-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252Fwnv17cpjDin2deSlOz0z%252Fuploads%252Fgit-blob-1b59a8140e413426b5f5eaa44b6f8d7fa1c24b1e%252Fbutton2d.png%3Falt%3Dmedia&width=768&dpr=4&quality=100&sign=940b736b&sv=1)
![](https://docs.incari.com/~gitbook/image?url=https%3A%2F%2F2628349686-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252Fwnv17cpjDin2deSlOz0z%252Fuploads%252Fgit-blob-880aed087f7143fd6cd17b929b592c029c085030%252Fbuttonafter.png%3Falt%3Dmedia&width=768&dpr=4&quality=100&sign=2b70b01e&sv=1)
Attributes
The Object's Attributes can be used to fully customize the Object. Explained below, they are:
Transformation
![](https://docs.incari.com/~gitbook/image?url=https%3A%2F%2F2628349686-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252Fwnv17cpjDin2deSlOz0z%252Fuploads%252Fgit-blob-2c61d9a83c0cb34306d8df159bfa7da93c0f0bd8%252Fbuttonattstransformation.png%3Falt%3Dmedia&width=768&dpr=4&quality=100&sign=33d8f919&sv=1)
The Transformation
Attributes deal with placement, rotation, and size in XY space. More information can be found here.
Text
![](https://docs.incari.com/~gitbook/image?url=https%3A%2F%2F2628349686-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252Fwnv17cpjDin2deSlOz0z%252Fuploads%252Fgit-blob-ca090c2d6aebb15ab6de16cf8835c0585d94cd41%252Fbuttonattstext.png%3Falt%3Dmedia&width=768&dpr=4&quality=100&sign=1c479d7b&sv=1)
The Text
Attributes customize the textual elements of a Button.
Text
is 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.Font family
offers three different font types:monospace
,sans-serif
, andserif
. More fonts can be added by the user in Project Settings.Transform
can easily change certain text aesthetics without requiring the user to change theText
Attribute itself.Capitalize
makes the first letter capital,uppercase
makes all letters capital, andlowercase
makes all letters lowercase.Font size (px)
determines the size of the font in pixels.Font color
decides the color of the Button's text.
Button
![](https://docs.incari.com/~gitbook/image?url=https%3A%2F%2F2628349686-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252Fwnv17cpjDin2deSlOz0z%252Fuploads%252Fgit-blob-de223b7f65fa1254b6165895c28e4f8c937902ab%252Fbuttonattsbutton.png%3Falt%3Dmedia&width=768&dpr=4&quality=100&sign=a2873ed1&sv=1)
The Button
Attributes provide crucial visual aspects for a Button Object.
Background Color
determines 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.
Code
![](https://docs.incari.com/~gitbook/image?url=https%3A%2F%2F2628349686-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252Fwnv17cpjDin2deSlOz0z%252Fuploads%252Fgit-blob-3e0c8c793b094cde31dfa86e772e4caafa616ab7%252Fbuttonattscode.png%3Falt%3Dmedia&width=768&dpr=4&quality=100&sign=7a52cce7&sv=1)
The Code
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.
Class names
contain the CSS class names of the Object.Stylesheet
contains the CSS stylesheet of the Object.
Tag
![](https://docs.incari.com/~gitbook/image?url=https%3A%2F%2F2628349686-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252Fwnv17cpjDin2deSlOz0z%252Fuploads%252Fgit-blob-dc4f375e34ce9bdd2bebc3e93ff34c8680ab55bb%252Fbuttonattstag.png%3Falt%3Dmedia&width=768&dpr=4&quality=100&sign=a6d09678&sv=1)
This Attribute manages the tags for the Button. See more on tags here.
Last updated