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

done()

Description Checks whether or not an Animation has finished all of its repetitions. To set this parameter immediately, use setDone().
Prototype

boolean done();

Parameters   (none)
Return boolean Returns true if an Animation has finished; false otherwise.
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();
  if (test.done()) // check to see if the Animation is done.
    text("The animation is done.", 25, 25);
  else  
    text("The animation is not done. (Click to finish it.)", 25, 25);
  
}

void mousePressed()
{
  test.setDone();
}