This commit is contained in:
Лаврёнов Антон
2014-02-25 00:40:35 +08:00
parent 7e62414f0c
commit 08d9be8371
2 changed files with 67 additions and 0 deletions

View File

@@ -60,6 +60,17 @@
// reset index when animation changes
this.frameIndex(0);
});
// smooth change for frameRate
var that = this;
this.on('frameRateChange.kinetic', function() {
if (!this.anim.isRunning()) {
return;
}
clearInterval(this.interval);
this.interval = setInterval(function() {
that._updateIndex();
}, 1000 / this.getFrameRate());
});
this.sceneFunc(this._sceneFunc);
this.hitFunc(this._hitFunc);