import megamu.shapetween.*;
Tween ani;
Shaper cosine;
void setup(){
ani = new Tween(this, 2);
cosine = new CosineShaper( Tween.IN );
}
void draw(){
background(255);
if( playCount()%2 == 0 ) // if the play count is even
ani.setEasing( cosine );
else
ani.setEasing( "myCustomEasing" );
ellipse(ani.time()*width, ani.position()*height, 4, 4);
}
void myCustomEasing(float in){
return 1 - (1-in)*(1-in);
}
setEasing(shape)
setEasing(shape, easeMode)ani.setEasing( Tween.COSINE )ani.setEasing( new CosineShaper() )ani.setEasing( "customEasing" );
void customEasing( float in ){
return 1 - (1-in)*(1-in);
}