Class: EditButtons

EditButtons(_sketch, _buttonsStruct, _containerDimensions)

A class that extends the Buttons class and provides extra methods for touch checking in a grid editing context.

Constructor

new EditButtons(_sketch, _buttonsStruct, _containerDimensions)

Creates a new instance of EditButtons.

Parameters:
Name Type Description
_sketch p5

A p5.js sketch instance.

_buttonsStruct Object

An object containing button structure information.

_containerDimensions Object

An object containing dimensions of the container holding the buttons.

Extends

Methods

draw()

Draws the buttons on the sketch.

Overrides:

touch_check(theGrid, navignBtns)

Handles touch checking for EditButtons instances.

Parameters:
Name Type Description
theGrid Grid

An instance of the Grid class.

navignBtns NavButtons

An instance of the NavButtons class.

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.

Overrides:
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