change method name

This commit is contained in:
lavrton
2015-01-21 17:22:41 +07:00
parent 9acf26bfd5
commit e6115ef643
2 changed files with 44 additions and 37 deletions

View File

@@ -87,7 +87,7 @@
index = this.frameIndex(),
ix4 = index * 4,
set = this.getAnimations()[anim],
offsets = this.getOffsets(),
offsets = this.frameOffsets(),
x = set[ix4 + 0],
y = set[ix4 + 1],
width = set[ix4 + 2],
@@ -109,11 +109,18 @@
index = this.frameIndex(),
ix4 = index * 4,
set = this.getAnimations()[anim],
offsets = this.frameOffsets(),
width = set[ix4 + 2],
height = set[ix4 + 3];
context.beginPath();
if (offsets) {
var offset = offsets[anim];
var ix2 = index * 2;
context.rect(offset[ix2 + 0], offset[ix2 + 1], width, height);
} else {
context.rect(0, 0, width, height);
}
context.closePath();
context.fillShape(this);
},
@@ -233,7 +240,7 @@
* });
*/
Kinetic.Factory.addGetterSetter(Kinetic.Sprite, 'offsets');
Kinetic.Factory.addGetterSetter(Kinetic.Sprite, 'frameOffsets');
/**
* get/set offsets map

BIN
test/assets/rabbit.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 194 KiB