Using setTimeout() function in processing.js program
in
Processing with Other Languages
•
9 months ago
Hey guys,
Sorry if I've posted this in the wrong place.
I want to make a program where something appears on the canvas after a certain amount of time. I've used setTimeout() and this is what my code basically looks like:
- void drawSomething() {
- setTimeout(function() {
- /* DRAW SOMETHING */
- }, 1500);
- }
- /* SOME OTHER FUNCTIONS HERE */
- void draw() {
- drawSomething();
- }
However, the
setTimeout()
function only runs once (the first time the
drawSomething()
function is called). What am I doing wrong?
Thank you!
1