Skip to content

Instantly share code, notes, and snippets.

@silmood
Created July 6, 2021 23:49
Show Gist options
  • Select an option

  • Save silmood/4b5b4dc5bceedd4d87e386c339a7a919 to your computer and use it in GitHub Desktop.

Select an option

Save silmood/4b5b4dc5bceedd4d87e386c339a7a919 to your computer and use it in GitHub Desktop.
ccapture-p5js.js
// Es necesario incluir la librería de CCapture dentro de tu proyecto: https://github.com/spite/ccapture.js/
let capturer
let renderer
let duration = 120
function setup() {
renderer = createCanvas(400, 400)
capturer = new CCapture( { format: 'png', framerate: 60, quality: 30 } )
frameRate(60)
}
function draw() {
_draw()
if(frameCount == 0) {
capturer.start()
capturer.capture(renderer.canvas)
} else if(frameCount >= duration){
capturer.stop()
capturer.save()
}
capturer.capture(renderer.canvas)
}
function _draw() {
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment