Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Abacus API Notes
var mainLoop = Abacus.timer({
callback: function( data ) {
data.delta // time since the last tick
data.ticks // zero indexed number of ticks
}
});
// Start the timer with an optional kill time in miliseconds
// if no miliseconds are passed in, it wil run FOR EV AR, until you pause it
mainLoop.start( 10000 )
// Stop the timer
mainLoop.pause()
///////////////////////////////
var animation = Abacus.animation({
timer: mainLoop,
tween: function (){} || 'tweenName', // name of the tween to use, default is 'numeric', 'null runs no tween'
})
animation.addFrame({
index: 3,
value: '' || num || [] || [[], [], []] || {}, {{},{}},
tween: function (){} || 'tweenName', // name of the tween to use, default is 'numeric', 'null runs no tween'
beforeTween: function(){
// function to run before tween
this.tween // name of tween
this.value // the keyframe value
},
afterTween: function(){
// function to run after tween
this.tween // name of tween
this.value // the keyframe value
}
});
animation.removeFrame( index )
animation.start()
animation.stop()
@mzgoddard

This comment has been minimized.

Copy link

@mzgoddard mzgoddard commented Oct 16, 2011

What is callback for? Is it where the tween function goes? Should it the option be called 'tweener' in that case?

Where does layer put the updated values?

var obj = {
    position: [0,0,0]
  },
  layer = Abacus.layer({
  timer: mainLoop,
  target: obj,
  name: 'position'
})

?

@boazsender

This comment has been minimized.

Copy link
Owner Author

@boazsender boazsender commented Oct 16, 2011

Updated, this should be clearer now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.