# Toggle

The **Toggle** **Object** is a **2D GUI Object** that has two states: checked or unchecked. Its initial state and colors can be customized in the [**Attributes**](#attributes).

![Toggle.](https://2628349686-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fwnv17cpjDin2deSlOz0z%2Fuploads%2Fgit-blob-74e70df2cb6245092a6556d196f7e2e054a2d000%2F2dgui-toggle.png?alt=media)

![Toggle example.](https://2628349686-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fwnv17cpjDin2deSlOz0z%2Fuploads%2Fgit-blob-32da3a675bb4cbe0604173fa8a5223ffe44008a1%2Ftoggle-example.gif?alt=media)

## Attributes

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

* [**Transformation**](#transformation)
* [**Toggle**](#toggle)
* [**Code**](#code)
* [**Tag**](#tag)

### Transformation

![Transformation Attributes.](https://2628349686-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fwnv17cpjDin2deSlOz0z%2Fuploads%2Fgit-blob-de9498c53ba90a28a0fb67a48c09191ee28730af%2Ftoggleattstransformation.png?alt=media)

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

### Toggle

![Toggle Attributes.](https://2628349686-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fwnv17cpjDin2deSlOz0z%2Fuploads%2Fgit-blob-b643e30f6ce17dbb79bc8a092b3438b3177ce7d5%2Ftoggleattstoggle.png?alt=media)

The `Toggle` **Attributes** provide crucial data for a **Toggle Object**.

* `Is checked` can be enabled or disabled. Enabled toggles it on and disabled toggles it off.
* `Handle Color` is the color of the **Toggle's** handle. It is the small circle which appears on the background of the **Toggle**.
* `Background Color Checked` is the color of the background when `Is checked` is enabled.
* `Background Color Unchecked` is the color of the background when `Is checked` is disabled.

### Code

![Code Attributes.](https://2628349686-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fwnv17cpjDin2deSlOz0z%2Fuploads%2Fgit-blob-3e0c8c793b094cde31dfa86e772e4caafa616ab7%2Fbuttonattscode.png?alt=media)

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

To address these in the **Logic**, please refer to the [**Object 2D Nodes**](https://docs.incari.com/incari-studio/2023.1/toolbox/incari/object2d).

* `Class names` contain the *CSS* class names of the **Object**.
* `Stylesheet` contains the *CSS* stylesheet of the **Object**.

### Tag

![Tag Attributes.](https://2628349686-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fwnv17cpjDin2deSlOz0z%2Fuploads%2Fgit-blob-dc4f375e34ce9bdd2bebc3e93ff34c8680ab55bb%2Fbuttonattstag.png?alt=media)

This **Attribute** manages the *tags* for the **Toggle**. See more on *tags* [here.](https://docs.incari.com/incari-studio/2023.1/objects-and-types/attributes/common-attributes/tag)
