# Button

> 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 %}


---

# 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://kree.gitbook.io/documentation/kree-user-interface/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.
