new Button(x, y, action, texto)
A Button
Parameters:
| Name | Type | Default | Description |
|---|---|---|---|
x |
number | 0 | The X coordinate of the button |
y |
number | 0 | The Y Coordinate of the button |
action |
function | the action to perform | |
texto |
stringk | Text to display |
Methods
click()
On Click executes the function
mouseIn()
Checks if mouse is inside the button
render()
draws the Button