Skip to main content Link Menu Expand (external link) Document Search Copy Copied

bool released()

Returns true on the first loop iteration that the button is released, and false all other times.

This function does not block the loop, and thus should not be used in the same loop as things that can’t happen when the button is pressing. For this case, use clicked().

Example

brain Brain;
Button button(brain, 0, 0, 100, 50, color(255, 0, 0), color(200, 0, 0), "Click me!", 30, 20);

//... later in the code
if (button.released()) {
  //Do something
}