Constructor
new Button(pos, width, height-, text, bg_color)
Constructor for the button class
Parameters:
| Name | Type | Description |
|---|---|---|
pos |
p5.Vector | Position of the top left of the button |
width |
float | The width of the button |
height- |
float | The height of the button |
text |
string | The text to display on the button |
bg_color |
p5.Color | The background color |
Methods
draw()
Draws the button
isPressed() → {Boolean}
Determines if the button is pressed
Returns:
- If the button is pressed
- Type
- Boolean
tick()
Ticks the button
untick()
Unticks the button