Last active
October 21, 2022 01:42
-
-
Save jesi-rgb/b9bff93a3d8806578051f49427a7d928 to your computer and use it in GitHub Desktop.
saveGif is coming to p5.js! ๐ธ
This file has been truncated, but you can view the full file.
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
| /*! p5.js v1.4.1 July 26, 2022 */ | |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
saveGif is coming to p5 ๐ธ !
This is the minified, first and extremely buggy version of the
p5.jslibrary with the saveGif functionality implemented.Download and installation
Download this file to the folder in which you usually develop your sketches and make sure to import it properly from the
index.htmlfile!<script src=/path/to/sketch/p5.save-gif.js/>How to use
The saveGif function admits at most 3 arguments for now:
filenamefor the name of the file downloaded to your computerdurationduration in seconds that you wish to download from your animationdelaydelay in seconds that you wish to wait before recording the animation. The animation will nevertheless have a duration of what you specified on thedurationargument.As an example, I like to use it within the mouse/keyboard events:
This piece of code will wait for 1 second and then encode 3 seconds worth of frames (180 frames at 60fps).
Final note