/** * @file ui_label.js * @author frtk@tetalab */ NPGClient.UILabel = function(n, o) { // obj name this.name = n !== undefined ? n : ''; // bkg rect //this.bkg = r !== undefined ? r : new NPGClient.UIRect(); // pos this.x = o.x !== undefined ? o.x : 0; this.y = o.y !== undefined ? o.y : 0; // text this.text = o.text !== undefined ? o.text : ''; // text style this.s = o.style !== undefined ? o.style : new NPGClient.UITextStyle(); }; NPGClient.UILabel.prototype = { // Constructor constructor: NPGClient.UILabel, // draw: function(ctx) { var self = this; //self.rect.draw(ctx); NPGClient.Utils.setTxtStyle(ctx, self.s); ctx.fillText(self.text, self.x, self.y); /* ctx.font = self.font ctx.fillStyle = self.col; ctx.fillText(self.text, self.x, self.y); */ } };