decided to totally revert the pull request. the frame width and height should be used to define the width and height of the sprite frame, not the shape level width and height. This is because the frame height and width can change for different frames

This commit is contained in:
Eric Rowell
2012-12-06 20:23:18 -08:00
parent bec7f5450b
commit 9bbd5e41ec

View File

@@ -32,22 +32,18 @@
var anim = this.attrs.animation;
var index = this.attrs.index;
var f = this.attrs.animations[anim][index];
var width = f.width || this.attrs.width;
var height = f.height || this.attrs.height;
if(this.attrs.image) {
this.drawImage(context, this.attrs.image, f.x, f.y, f.width, f.height, 0, 0, width, height);
this.drawImage(context, this.attrs.image, f.x, f.y, f.width, f.height, 0, 0, f.width, f.height);
}
},
drawHitFunc: function(context) {
var anim = this.attrs.animation;
var index = this.attrs.index;
var f = this.attrs.animations[anim][index];
var width = f.width || this.attrs.width;
var height = f.height || this.attrs.height;
context.beginPath();
context.rect(0, 0, width, height);
context.rect(0, 0, f.width, f.height);
context.closePath();
this.fill(context);
},