Way to check if draw() is currently looping?

Is there any way to check if draw() is currently looping (ie if loop/noLoop was called)? There doesn’t seem to be a way to do this in the p5 library so is there some way to check under the hood?

This is the source code for the p5::noLoop() method:

And this is for the p5::loop() method:

So we just need to access the “private” undocumented property p5::_loop:
const isLooping = _loop;

4 Likes

Thanks for getting back to quickly GoToLoop! I was having trouble with_looping for some reason and just ended up using my own variable to keep track of it. I appreciate you helping out though :slight_smile: