> For the complete documentation index, see [llms.txt](https://kree.gitbook.io/documentation/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://kree.gitbook.io/documentation/kree-user-interface/button.md).

# Button

This User Interface Component Add more interaction between your game and your user

> Component Author: [Jabo](https://github.com/jabo-bernardo)\
> Release Date: April 15, 2020

{% tabs %}
{% tab title="Usage" %}

```java
new Button(Scene parentScene, String text, Vector2 position, Vector2 scale);
```

{% endtab %}

{% tab title="Methods" %}

```java
getTransform(); // Returns Transform Object

setColor(Color backgroundColor, Color foregroundColor, Color hoverColor);

setFont(Font font); // Sets the text font

setText(String text); // Sets the text of the button

setBackgroundImage(Sprite spr);

onClick(); // Returns true if the user clicked the button

onHover(); // Returns true if the user is hovering on the button
```

{% endtab %}
{% endtabs %}
