Tween::setPlayMode()
Description
Sets the current mode of play, using combinations of repeat and reversing.
Tween.ONCE plays the tween from 0 to 1, once.
Tween.REPEAT plays the tween from 0 to 1, and repeats until stopped.
Tween.REVERSE_ONCE plays the tween from 0 to 1, and then from 1 to 0.
Tween.REVERSE_REPEAT plays the tween from 0 to 1, back to 0 and then repeats.
Example
import megamu.shapetween.*;

Tween ani;
void setup(){
  ani = new Tween(this, 2);
  ani.setPlayMode( Tween.REVERSE_REPEAT );
  ani.start();
}

void draw(){
  background(255);
  ellipse(ani.time()*width, ani.position()*height, 4, 4);
}

void mousePressed(){
  ani.setPlayMode( Tween.ONCE );
}
Syntax
setPlayMode(mode)
Parameters
mode
int: Tween.ONCE (default), Tween.REPEAT, Tween.REVERSE_ONCE or Tween.REVERSE_REPEAT
Related
repeat()
noRepeat()
playCount()
setEasing()