noLoop();
Prevents lu5 from calling draw
again.
When noLoop
is called, the draw continues execution, but will not be called again.
angle = 0;
radius = 100;
function setup()
createWindow(300, 300);
textAlign(CENTER);
noStroke();
end
function draw()
background('purple');
text('Click to pause', width/2, height/2);
circle(
radius * cos(angle) + 150,
radius * sin(angle) + 150,
16
);
angle = angle + 0.05;
end
function mousePressed()
noLoop(); -- Stop loop
end
function mouseReleased()
loop();
end
Output