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.

Revisions

  1. silmood revised this gist Jul 6, 2021. 1 changed file with 2 additions and 1 deletion.
    3 changes: 2 additions & 1 deletion ccapture-p5js.js
    Original file line number Diff line number Diff line change
    @@ -2,6 +2,7 @@

    let capturer
    let renderer
    let duration = 120

    function setup() {
    renderer = createCanvas(400, 400)
    @@ -15,7 +16,7 @@ function draw() {
    if(frameCount == 0) {
    capturer.start()
    capturer.capture(renderer.canvas)
    } else if(frameCount >= 120){
    } else if(frameCount >= duration){
    capturer.stop()
    capturer.save()
    }
  2. silmood created this gist Jul 6, 2021.
    26 changes: 26 additions & 0 deletions ccapture-p5js.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,26 @@
    // Es necesario incluir la librería de CCapture dentro de tu proyecto: https://github.com/spite/ccapture.js/

    let capturer
    let renderer

    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 >= 120){
    capturer.stop()
    capturer.save()
    }
    capturer.capture(renderer.canvas)
    }

    function _draw() {
    }