Tween::setDuration()
Description
Sets the duration that a Tween will take to go from start to end.
Example
import megamu.shapetween.*;

Tween ani;
void setup(){
  ani = new Tween(this, 2.5);
}

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

void mousePressed(){
  ani.setDuration( 30, Tween.FRAMES );
}

void mouseReleased(){
  ani.setDuration( 2.5, Tween.SECONDS );
}
Syntax
setDuration(duration)
setDuration(duration, durationType)
Parameters
duration
float: tween duration in seconds unless you've set durationType to FRAMES
durationType
boolean: Tween.SECONDS or Tween.FRAMES (smoother)
Related
noEasing()
Shaper
time()
position()
playMode()
playCount()