Class: Buttons

Buttons(_sketch, _buttonsStruct, _containerDimensions)

Class representing the Buttons.

Constructor

new Buttons(_sketch, _buttonsStruct, _containerDimensions)

Creates an instance of Buttons.

Parameters:
Name Type Description
_sketch p5

The p5 instance.

_buttonsStruct Object

The buttons structure object.

_containerDimensions Object

The container dimensions object.

Methods

draw()

Draws the buttons on the sketch.

touch_check_helper() → {object}

Helper function for touch_check() method in Buttons class. Determines if a button has been clicked and which one it is.

Returns:

Object with "click" and "index" properties indicating if a button has been clicked and which button was clicked, respectively. "click" is a boolean and "index" is an integer.

Type
object