In Paper.js, is it possible to change the frame rate of the onFrame(event)
function? The paper.js website tutorial says the function is by default called 60 times per second, but it does not include if it is possible (and how) to change the frame rate of this function.
No, but you can easily skip frames in the code within your onFrame
function.
The following code emulates a 30 fps frame rate by skipping frames with an odd number, effectively halving the frame rate.
function onFrame(event) {
if (event.count % 2 === 0) {
//your code here
}
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With