Open jcubic opened 2 years ago
Hi @jcubic, Thank you for your suggestion.
This sounds good. It makes sense to reference the frame rate in p5.js, since generally the animation frame rate and the recording frame rate should match.
My only concern is that the API to get the target frame rate is not exposed by p5.js and must reference a private variable called _targetFrameRate
. This means that an update to p5.js could cause it to suddenly stop working.
Please give me some time as I need to do a little research on this.
If P5.js doesn't support the API to allow this, maybe it's worth creating an issue and asking if they are willing to expose the frame rate somehow.
That would be good. I have already created it. https://github.com/processing/p5.js/issues/5762
If I can get approval I would like to start working on it.
I'm not sure if this is possible but in my coding playground prototype:
https://p5.javascript.org.pl/amused-loan?template=none
To record a proper Gif I still need to put P5.capture code in my sketch. Capture frame rate should match frame rate from p5.js
If I want to capture the animation I need to copy paste p5.capture default config:
To not break the API, how about -1 value will mean that it should take frameRate from P5.js?