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 ); }
setPlayMode(mode)