nodePong/client/lib/ui/objects/ui_style.js
2016-02-14 04:37:31 +01:00

54 lines
925 B
JavaScript

/**
* @file ui_style.js
* @author frtk@tetalab
*/
NPGClient.UIStyle = function(o) {
/*
this.fm = o.fm !== undefined ? o.fm : false;
this.fc = o.fc !== undefined ? o.fc : '';
this.bm = o.bm !== undefined ? o.bm : false;
this.bw = o.bw !== undefined ? o.bw : 0;
this.bc = o.bc !== undefined ? o.bc : '';
*/
};
NPGClient.UIStyle.prototype = {
constructor: NPGClient.UIStyle,
/*
borderMode: function() {
return this.bm;
},
fillMode: function() {
return this.fm;
},
setBorders: function(m, w, c) {
this.bm = m;
this.bw = w;
this.bc = c;
},
setFillStyle: function(m, c) {
this.fm = m;
this.fc = c;
},
applyStyle: function(ctx) {
var self = this;
// fill style
if (self.fm == true) ctx.fillStyle = self.fc;
// border mode
if (bm == true) {
ctx.lineWidth = self.bw;
ctx.strokeStyle = self.bc;
}
}
*/
};