added setX and setY methods for convenience

This commit is contained in:
Eric Rowell
2012-04-08 18:22:04 -07:00
parent 4f36b27199
commit 30e8973956
3 changed files with 30 additions and 2 deletions

View File

@@ -250,6 +250,20 @@ Kinetic.Node.prototype = {
this.attrs.x = x;
this.attrs.y = y;
},
/**
* set node x position
* @param {Number} x
*/
setX: function(x) {
this.attrs.x = x;
},
/**
* set node y position
* @param {Number} y
*/
setY: function(y) {
this.attrs.y = y;
},
/**
* get node position relative to container
*/