0

I've got a simple tween:

const grass = styler(/* some element */)
const from = +grass.get('opacity')
const tweener = tween({from, to: 0, duration: 5000, ease: easing.linear}).start(v => grass.set('opacity', v))

How do I make it jump to the end of the tween and then stop tweening immediately? For example, in this case, jump to 0 opacity and stop tweening? I know I can do:

grass.set('opacity', 0)
tweener.stop()

but I believe there is a more natural solution. Something like:

tweener.jumpToEndAndStop()

TIA

danday74
  • 52,471
  • 49
  • 232
  • 283

1 Answers1

0

Based on https://code.tutsplus.com/tutorials/introduction-to-popmotion-part-1-tween--cms-30431 I think this is what I want:

tweener.seek(1)
tweener.stop()
danday74
  • 52,471
  • 49
  • 232
  • 283