tween-array
A tween object for tweenr which interpolates single-dimensional arrays.
var ticker = var array = var start = 0 0 end = 10 4 //push a tween object onto the stackticker //step the tickerticker console // -> [5, 2]
memory optimization
This is generally faster than object tweening and leads to less garbage. If you specify a start
parameter you can avoid creating any garbage, aside from the tween itself.
var start = 50 50 end = 100 100 tmp = 0 0var tween = tween console // -> [50, 50]console // -> [100, 100]
Usage
tween = array(target, end[, opt])
Creates a new array tween that can be ticked by tween-ticker or your engine of choice. This will tween the target
array to end
. Options are the same as ticker.to()
, additionally:
start
can be an array to use as the start values
If opt
is a number, it is assumed to be a duration.
//equivalent
License
MIT, see LICENSE.md for details.