mirror of
https://github.com/konvajs/konva.git
synced 2025-09-22 20:14:01 +08:00
you can now pass in custom drawFuncs and drawHitFuncs via shape constructors
This commit is contained in:
@@ -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);
|
||||
});
|
||||
|
Reference in New Issue
Block a user