2017-07-04 12:58:45 +00:00
|
|
|
var Class = require('../utils/Class');
|
2017-05-18 05:40:51 +00:00
|
|
|
var TweenBuilder = require('./TweenBuilder');
|
2017-05-18 03:02:07 +00:00
|
|
|
|
2017-07-04 12:58:45 +00:00
|
|
|
var Timeline = new Class({
|
2017-05-18 03:02:07 +00:00
|
|
|
|
2017-07-04 12:58:45 +00:00
|
|
|
initialize:
|
2017-05-18 03:02:07 +00:00
|
|
|
|
2017-07-04 12:58:45 +00:00
|
|
|
function Timeline (manager)
|
|
|
|
{
|
|
|
|
this.manager = manager;
|
2017-05-18 03:02:07 +00:00
|
|
|
|
2017-07-04 12:58:45 +00:00
|
|
|
this.tweens = [];
|
2017-05-18 03:02:07 +00:00
|
|
|
|
2017-07-04 12:58:45 +00:00
|
|
|
this.paused = true;
|
2017-05-18 03:02:07 +00:00
|
|
|
|
2017-07-04 12:58:45 +00:00
|
|
|
this.callbacks = {
|
|
|
|
onStart: { callback: null, scope: null, params: null },
|
|
|
|
onUpdate: { callback: null, scope: null, params: null },
|
|
|
|
onRepeat: { callback: null, scope: null, params: null },
|
|
|
|
onComplete: { callback: null, scope: null, params: null }
|
|
|
|
};
|
2017-05-18 03:02:07 +00:00
|
|
|
|
2017-07-04 12:58:45 +00:00
|
|
|
this.callbackScope;
|
|
|
|
},
|
2017-05-18 03:02:07 +00:00
|
|
|
|
|
|
|
add: function (config)
|
|
|
|
{
|
|
|
|
TweenBuilder(this, config);
|
|
|
|
|
|
|
|
return this;
|
|
|
|
},
|
|
|
|
|
|
|
|
queue: function (tween)
|
|
|
|
{
|
|
|
|
// Add to this timeline
|
|
|
|
|
|
|
|
this.tweens.push(tween);
|
|
|
|
}
|
|
|
|
|
2017-07-04 12:58:45 +00:00
|
|
|
});
|
2017-05-18 03:02:07 +00:00
|
|
|
|
|
|
|
module.exports = Timeline;
|