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:
https://p5js.org/reference/#/p5/noLoop

And this is for the p5::loop() method:
https://p5js.org/reference/#/p5/loop

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

3 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: