rocinantealpha

reference / time and animation

tween

Moves a number, vector or color to a value over some seconds, a little each frame: tween ball.pos to mouse over 0.5 as out. A new tween of the same place replaces the old.

ball = { pos: { 60, 150 } }tween ball.pos to { 340, 150 } over 2 as bouncedraw [  background 240  circle at ball.pos radius 24 fill tomato]
what it draws: the whole window, 400 by 300
What the example of tween draws

How to write it

tween place to value over number [as word]

Words it takes

after as
smooth, linear, in, out, back, elastic, bounce

Related