Skip to content

1. Initialize tween

Anton Kosykh edited this page Jan 11, 2018 · 4 revisions

Code

NanoTween uses NanoTween.update global method to handle ticks.
So you can copy-paste this code to initialize NanoTween:

const animate = (time) => {
  requestAnimationFrame(animate)
  NanoTween.update(time)
}
animate(performance.now())

So we just use requestAnimationFrame and performance.now and are happy

Clone this wiki locally