Created
November 7, 2018 21:56
-
-
Save wonderburg7/d5b04127596aa44084b7ac9d31ae6064 to your computer and use it in GitHub Desktop.
bad scrolling writing.pde
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
/* | |
* Demonstrates the use of the GifAnimation library. | |
* Exports a GIF-File to the sketch folder if space | |
* bar is pressed. Wow, feels like 90's! ;) | |
*/ | |
import gifAnimation.*; | |
import processing.opengl.*; | |
GifMaker gifExport; | |
PImage img; | |
int length1 = 1000; | |
public void setup() { | |
size(1000, 420, OPENGL); | |
frameRate(100); | |
img = loadImage("text2.png"); | |
println("gifAnimation " + Gif.version()); | |
gifExport = new GifMaker(this, "export.gif"); | |
gifExport.setRepeat(0); // make it an "endless" animation | |
gifExport.setTransparent(1,0,0); // make black the transparent color. every black pixel in the animation will be transparent | |
// GIF doesn't know have alpha values like processing. a pixel can only be totally transparent or totally opaque. | |
// set the processing background and the transparent gif color to the same value as the gifs destination background color | |
// (e.g. the website bg-color). Like this you can have the antialiasing from processing in the gif. | |
gifExport.setDelay(1000/1000); | |
} | |
void draw() { | |
background(1, 0, 0); | |
// translate(width/2, height/2); | |
image(img, length1,height/4); | |
gifExport.setDelay(1); | |
gifExport.addFrame(); | |
length1 = length1-1; | |
} | |
void keyPressed() { | |
gifExport.finish(); | |
println("gif saved"); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment