The redraw() function is used to execute the code within draw() function one time. This functions is used to update the display window only when it necessary. The redraw() function does not work when it is called inside the draw() function. The loop() and noLoop() function is used to enable/disable the animations.
redraw( n )
Parameters: This function accepts single parameter n which is used to set the redraw for n times. The default value of this function is 1.
Below example illustrates the redraw() function in p5.js:
- How to get the function name inside a function in PHP ?
- p5.js | log() function
- D3.js | d3.map.get() Function
- D3.js | d3.sum() function
- p5.js | cos() function
- D3.js | d3.map.has() Function
- p5.js | min() function
- PHP | Ds\Map get() Function
- p5.js | red() function
- D3.js | d3.hcl() Function
- PHP | cos( ) Function
- p5.js | str() function
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.