# 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**](/incari-studio/2024.1/toolbox/events/mouse.md). A **Button's** text, placement, and size can be altered using the [**Attributes**](#attributes).

![Button.](/files/6Mc8X38jm3PjNkkRIFvr)

![Button with Text.](/files/p6q5E1zs9KQa65ggw3bp)

## Attributes

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

* [**Transformation**](#transformation)
* [**Text**](#text)
* [**Font**](#font)
* [**Style**](#code)
* [**Tag**](#tag)

### Transformation

![Transformation Attributes.](/files/yFFXvQGzu8B6EyMKMwVJ)

The `Transformation` **Attributes** deal with placement, rotation, and size in *XY* space. More information can be found [here](/incari-studio/2024.1/objects-and-types/attributes/common-attributes/transformation.md).

### 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 and Translation.](/files/tDPDD7Jr4e8xwGcV2C3b)

#### Static Text

![Static Text Attributes.](/files/mWmiCLN51kFkZnUzgIxK)

When `Static Text` is selected, the **Attributes** are:

* `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.
* `Color` decides the color of the **Button's** text.
* `Transform` can easily change certain text aesthetics without requiring the user to change the `Text` **Attribute** itself. `Capitalize` makes the first letter capital, `uppercase` makes all letters capital, and `lowercase` makes all letters lowercase.

#### Translation

![Translation Attributes.](/files/jfJEPmxN5O6QNpUbj1dQ)

When `Translation` is selected, the **Attributes** are:

* `Translation` lets the user choose the key of the current language (which is established in the [**Project Settings**](/incari-studio/2024.1/modules/project-settings/localization.md)). In the image above, the selected key is `phrase`.
* `Color` decides the color of the **Button's** translation.
* `Transform` can easily change certain text aesthetics without requiring the user to change the `Translation` **Attribute** itself. `Capitalize` makes the first letter capital, `uppercase` makes all letters capital, and `lowercase` makes all letters lowercase.

### Font

![Font Attributes.](/files/STIiajfJdckNx03lyAQK)

The `Font` **Attributes** focus on the details of the **Button's** text. Please note that while **Buttons** are capable of handling [*variable fonts*](/incari-studio/2024.1/modules/project-settings/fonts.md#variable-fonts), only the default style will be used, as the configurable **Attributes** are not available for this **Object**.

* `Family` offers two different font types: `Manrope` and `Source Code Pro`. More fonts can be added by the user in [**Project Settings**](/incari-studio/2024.1/modules/project-settings/fonts.md).
* `Size` determines the size of the font in pixels.

### Style

![Style Attributes.](/files/D7Lw74v0i5N0Ql8Ws80R)

The `Style` **Attributes** allow for more customizability. This can override any stylesheet provided in the [**Project Settings**](/incari-studio/2024.1/modules/project-settings/style.md) or a [**Scene2D**](/incari-studio/2024.1/objects-and-types/project-objects/scene2d.md).

To address these in the **Logic**, please refer to the [**Object 2D Nodes**](/incari-studio/2024.1/toolbox/incari/object2d.md).

* `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.
* `CSS Classes` contain the *CSS* class names of the **Object**.
* `Stylesheet` contains the *CSS* stylesheet of the **Object**.

### Tag

![Tag Attributes.](/files/AcVS9u9EJzK2klOH2pFq)

This **Attribute** manages the *tags* for the **Button**. See more on *tags* [here.](/incari-studio/2024.1/objects-and-types/attributes/common-attributes/tag.md)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.incari.com/incari-studio/2024.1/objects-and-types/scene2d-objects/gui/button.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
