a bit of refactoring here and there, added some getters and setters that i missed in Kinetic.Sprite

This commit is contained in:
Eric Rowell
2012-05-13 14:04:29 -07:00
parent ec415c55de
commit c6040ebf9d
7 changed files with 68 additions and 20 deletions

View File

@@ -9,8 +9,8 @@
*/
Kinetic.Sprite = function(config) {
this.setDefaultAttrs({
index: 0,
frameRate: 17
index: 0,
frameRate: 17
});
config.drawFunc = function() {
@@ -69,6 +69,25 @@ Kinetic.Sprite.prototype = {
setAnimation: function(anim) {
this.attrs.animation = anim;
},
/**
* set animations obect
* @param {Object} animations
*/
setAnimations: function(animations) {
this.attrs.animations = animations;
},
/**
* get animations object
*/
getAnimations: function() {
return this.attrs.animations;
},
/**
* get animation key
*/
getAnimation: function() {
return this.attrs.animation;
},
/**
* set animation frame index
* @param {Integer} index frame index