Class: Button

Button(_sketch, _labelImg, _disabled, _clicked, _x, _y, _width, _height)

Class representing a button

Constructor

new Button(_sketch, _labelImg, _disabled, _clicked, _x, _y, _width, _height)

Creates a button

Parameters:
Name Type Description
_sketch p5

The p5 sketch

_labelImg p5.Image

The image for the button label

_disabled Boolean

Flag for whether the button is disabled

_clicked Boolean

Flag for whether the button is clicked

_x Number

The x-coordinate for the button's position

_y Number

The y-coordinate for the button's position

_width Number

The width of the button

_height Number

The height of the button