我有一个简单的青少年:
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))
我该如何让它跳到青少年的末尾,然后立即停止推特?例如,在这种情况下,跳到0不透明度并停止粗花呢?我知道我能做到:
grass.set('opacity', 0)
tweener.stop()
但我相信还有一个更自然的解决方案。类似于:
tweener.jumpToEndAndStop()
TIA-
基于https://code.tutsplus.com/tutorials/introduction-to-popmotion-part-1-tween--cms-30431我想这就是我想要的:
tweener.seek(1)
tweener.stop()