Determine if loop()/noLoop() is currently active

edited February 2018 in Questions about Code

Quick question, is there a global variable or something equivalent I can use to get a boolean for whether loop() is currently running? I appreciate I can just make one, but if there's one that already exists within Processing I feel it would be best to use it.

I want to have the mousePressed() function to do something similar to below but can't seem to find anything specific for Processing:

void mousePressed(){ if(looping) noLoop(); else loop(); }

Sorry if I've missed an article that covers this :-)

Many thanks.

Answers

Sign In or Register to comment.