further decoupled scene, hit, and buffer graph drawing. To define a custom hit draw function, you now need to set the drawHitFunc attr.

This commit is contained in:
Eric Rowell
2012-11-18 19:50:50 -08:00
parent e04b979063
commit 27d5031665
14 changed files with 197 additions and 113 deletions

View File

@@ -20,8 +20,8 @@ Kinetic.Sprite.prototype = {
this.shapeType = "Sprite";
config.drawFunc = this.drawFunc;
if(!config.drawBufferFunc) {
config.drawBufferFunc = this.drawBufferFunc;
if(!config.drawHitFunc) {
config.drawHitFunc = this.drawHitFunc;
}
// call super constructor
@@ -53,7 +53,7 @@ Kinetic.Sprite.prototype = {
this.drawImage(context, this.attrs.image, f.x, f.y, f.width, f.height, 0, 0, f.width, f.height);
}
},
drawBufferFunc: function(context) {
drawHitFunc: function(context) {
var anim = this.attrs.animation;
var index = this.attrs.index;
var f = this.attrs.animations[anim][index];