noLoop() if !focused

Hi

I noticed that having a p5.js sketch running in my browser is taxing CPU load, even if the sketch in a tab that is not showing.

how would you do to have the sketch going noLoop() when not in focused and resume loop() when focused is back ?

is there a resumeFocus() event function in p5.js ?

would it be a good id to catch the last frame into an image and display it while out of focuse ?

Answers

Sign In or Register to comment.