46 lines
548 B
JavaScript
46 lines
548 B
JavaScript
|
/**
|
||
|
* @file ui_shape.js
|
||
|
* @author frtk@tetalab
|
||
|
*/
|
||
|
//
|
||
|
|
||
|
NPGClient.UIShape = function() {
|
||
|
this.x = 0; // x position
|
||
|
this.y = 0; // y position
|
||
|
};
|
||
|
|
||
|
|
||
|
/**
|
||
|
*
|
||
|
*/
|
||
|
NPGClient.UIShape.prototype = {
|
||
|
|
||
|
// Constructor
|
||
|
constructor: NPGClient.UIShape,
|
||
|
|
||
|
//
|
||
|
moveTo: function(x, y) {
|
||
|
var self = this;
|
||
|
self.x = x;
|
||
|
self.y = y;
|
||
|
},
|
||
|
|
||
|
//
|
||
|
move: function(x, y) {
|
||
|
var self = this;
|
||
|
self.x += x;
|
||
|
self.y += y;
|
||
|
},
|
||
|
|
||
|
//
|
||
|
shiftX: function(x) {
|
||
|
this.x += x;
|
||
|
},
|
||
|
|
||
|
//
|
||
|
shiftY: function(y) {
|
||
|
this.y += y;
|
||
|
}
|
||
|
|
||
|
};
|