Animation Overview - News - Installation - Reference - Examples - FAQ  
 

setDone()

Description Forces an Animation to finish. (Does not run the animation-end method.) To re-run an Animation, use reset().
Prototype

setDone();

Parameters   (none)
Return   (none)
Example

 

Animation test;
BFont font;

void setup()
{
  size(400,100);
  font = loadFont("RotisSanSer.vlw.gz");
  textFont(font, 20);
  
  test = new Animation(this, loadImage("image.gif"), 100,40, 200,40);
}

void loop()
{
  background(127);
  test.draw();
  text("Click to stop the animation.", 25, 25);
}

void mousePressed()
{
  test.setDone(); // finishes the Animation immediately.
}