This commit is contained in:
jdescottes
2013-12-06 18:04:04 +01:00
parent cecadf54e1
commit b11b16b427
10 changed files with 71 additions and 18 deletions

View File

@ -5,6 +5,8 @@
* @constructor
* @param {Number} width
* @param {Number} height
* @param {String} name
* @param {String} description
*/
ns.Piskel = function (width, height) {
if (width && height) {
@ -16,6 +18,8 @@
/** @type {Number} */
this.height = height;
this.descriptor = null;
} else {
throw 'Missing arguments in Piskel constructor : ' + Array.prototype.join.call(arguments, ",");
}
@ -96,4 +100,15 @@
this.layers.splice(index, 1);
};
ns.Piskel.prototype.getDescriptor = function () {
return this.descriptor;
};
ns.Piskel.prototype.setDescriptor = function (name, desc) {
this.descriptor = {
name : name,
description : desc
};
};
})();

View File