Sharing my personal tween version

I’m sharing with the community my personal version of the tween object. Allow me to:

  • use other units than seconds,
  • stop a “forever” loop,
  • use other units than seconds,
  • pause a tween,
  • use other units than seconds.

I believe Codea’s tweens can do all these things (apart from using units other than seconds, which I can’t see a need for).

This is how to pause tweens (thanks to toffer)

local update,noop = tween.update,function() end
tween.pauseAll = function()
    tween.update = noop
tween.resumeAll = function()
    tween.update = update

Nice trick to pause a tween :-bd, thank you.