VOOZH about

URL: https://www.geeksforgeeks.org/javascript/p5-js-noloop-function/

⇱ p5.js noLoop() Function - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

p5.js noLoop() Function

Last Updated : 16 Aug, 2023
The noLoop() function is used to stop the program after executing the draw() function. The loop() function runs the draw() function again and again. If noLoop() function is used in setup() function then it should be the last line inside the block. If noLoop() function is used then it is not possible to change or access the screen inside event handling functions such as mousePressed() or keyPressed(). Syntax:
noLoop()
Below examples illustrate the noLoop() function in p5.js: Example 1: Output: 👁 Image
Example 2:
Output: 👁 Image
Comment