0.1.0 • Published 9 years ago

@mattstyles/tick v0.1.0

Weekly downloads
-
License
ISC
Repository
github
Last release
9 years ago

tick

Framelimits raf-stream

npm i -S @mattstyles/tick
import Tick from '@mattstyles/tick'

let tick = new Tick({
  frameRate: 30
})

tick.on( 'data', dt => {
  console.log( dt ) // ~33.333
})

API

new Tick( ) constructor

let tick = new Tick({
  el: document.querySelector( 'canvas' ),
  frameRate: 8
})
  • el the dom element to attach to

  • frameRate ticks per second

Framerate can be changed on fly just by setting it

tick.frameRate = 20

.pause()

Paused the raf event stream

.resume()

Resumes the raf event stream

0.1.0

9 years ago

0.0.1

9 years ago