mouseReleased(button);
EventCalled when a mouse button is released.
Arguments
button
The released mouse button
In the following example, the circle's size increases when the user clicks the mouse.
size = 12;
function setup()
createWindow(400, 400);
textAlign(CENTER);
end
function draw()
background('purple');
text('Click to grow the circle', width/2, 50);
circle(width/2, height/2, size);
end
-- Increase circle size when mouse released
function mouseReleased()
size = size + 3;
end
Output