Created
July 6, 2021 23:49
-
-
Save silmood/4b5b4dc5bceedd4d87e386c339a7a919 to your computer and use it in GitHub Desktop.
ccapture-p5js.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // 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