-
-
Save mzgoddard/1291169 to your computer and use it in GitHub Desktop.
Abacus API Notes
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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({ | |
rate: 60, // number of indices per second | |
timer: mainLoop, | |
tween: function (){} || 'tweenName', // name of the tween to use, default is 'numeric', 'null runs no tween' | |
}) | |
var layer = animation.layer( 0 || { | |
index: 0, | |
tween: function() {} || 'tweenName', // name of the tween to use, default is 'numeric', 'null runs no tween' | |
}); | |
layer.addFrame({ | |
index: 3, | |
value: [] || [[], [], []] || {}, {{},{}}, | |
tween: function (){} || 'tweenName', // name of the tween to use, default is 'numeric', 'null runs no tween' | |
beforeTween: 'method' || function(){ | |
// function to run before tween | |
this.tween // name of tween | |
this.value // the keyframe value | |
}, | |
afterTween: 'method' || function(){ | |
// function to run after tween | |
this.tween // name of tween | |
this.value // the keyframe value | |
} | |
}); | |
animation.layer( index ).removeFrame( index ) | |
animation.start( target ) | |
animation.stop() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment