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

currentRepetition()

Description Returns the number of times the Animation has executed. The first time an Animation executes, currentRepetition() returns 0.
Prototype

long currentRepetition();

Parameters   (none)
Return long The number of times an Animation has executed.
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);
  test.showRectangle();
}

void loop()
{
  background(127);
  test.draw();
  long count = test.currentRepetition(); // get repetition count
  text("Animation has performed " + count + " repetitions.", 25, 25);
}