gif-export

int a = 0;

void setup() {
  size(540, 540);
}

void draw() {
ellipse(width/2,height/2,a,a);
a++;

// Call the gif-export-function and 
// specify the number of frames you want to render
  gif(40);
}

---

The gif-function can be stored in a separate file (gifexport.pde)

import gifAnimation.*;

// Objekt
GifMaker gifExport;

void gifsetup() {
  println("gifAnimation " + Gif.version());
  gifExport = new GifMaker(this, "export.gif");
  gifExport.setRepeat(0);
  gifExport.setDelay(50);
}

void gif(int frames) {

  if (frameCount == 1){
   gifsetup(); 
  }

  gifExport.addFrame();
  if (frameCount == frames) {
    gifExport.finish();
    println("gif saved");
    exit();
  }
}

results matching ""

    No results matching ""