you can now pass in custom drawFuncs and drawHitFuncs via shape constructors

This commit is contained in:
Eric Rowell
2012-11-18 20:28:55 -08:00
parent 27d5031665
commit c121e4b941
13 changed files with 32 additions and 25 deletions

View File

@@ -18,17 +18,14 @@ Kinetic.Sprite.prototype = {
frameRate: 17
});
this.shapeType = "Sprite";
config.drawFunc = this.drawFunc;
if(!config.drawHitFunc) {
config.drawHitFunc = this.drawHitFunc;
}
// call super constructor
Kinetic.Shape.call(this, config);
this._setDrawFuncs();
this.anim = new Kinetic.Animation();
var that = this;
this.on('animationChange.kinetic', function() {
this.on('animationChange', function() {
// reset index when animation changes
that.setIndex(0);
});