Last active
September 9, 2018 01:00
-
-
Save playgrdstar/2ce7954f3d441a5db06536462e0c90ed to your computer and use it in GitHub Desktop.
How to use Ccapture library in p5
This file contains 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
var capturer = new CCapture({ | |
format: 'jpg', | |
name: 'name' | |
}); | |
var canvas; | |
function setup() { | |
var p5Canvas = createCanvas(800, 800); | |
canvas = p5Canvas.canvas; | |
background(0,255); | |
... | |
capturer.start(); | |
} | |
function draw() { | |
... | |
// This is set to a trigger based on the number of frames that have elapsed. | |
// Can also be set to a mouse press event | |
if (frameCount < loopFrame) { | |
capturer.capture(canvas); | |
} else if (frameCount === loopFrame) { | |
capturer.stop(); | |
capturer.save(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment