mirror of
https://github.com/konvajs/konva.git
synced 2025-09-22 20:14:01 +08:00
a bit of refactoring here and there, added some getters and setters that i missed in Kinetic.Sprite
This commit is contained in:
@@ -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
|
||||
|
Reference in New Issue
Block a user