From 6a16ad9c408fb84dd27c618312f3111563ca2ad5 Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Tue, 9 Dec 2014 01:40:49 -0500 Subject: blitting functions --- js/lex.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'js/lex.js') diff --git a/js/lex.js b/js/lex.js index 1dc07a0..62144b6 100644 --- a/js/lex.js +++ b/js/lex.js @@ -10,12 +10,14 @@ function Lex (x,y) { this.fg = colors.white this.bg = colors.black this.char = " " + this.opacity = 1 } Lex.prototype.build = function(){ this.span.className = this.css() this.span.innerHTML = this.html() } Lex.prototype.css = function(){ + if (this.opacity == 0) return "fabb" return "f" + letters[mod(this.fg,16)] + "b" + letters[mod(this.bg,16)] } Lex.prototype.html = function(){ @@ -52,16 +54,17 @@ Lex.prototype.clone = function (lex){ this.fg = lex.fg this.bg = lex.bg this.char = lex.char + this.opacity = lex.opacity this.build() } -Lex.prototype.erase = function (lex){ - if (lex.opacity == 0) return +Lex.prototype.erase = function (){ this.fg = colors.white this.bg = colors.black this.char = " " + this.opacity = 0 this.build() } -Lex.prototype.fill = function(fg,bg){ +Lex.prototype.fill = function(fg, bg){ this.fg = fg this.bg = bg this.opacity = 1 -- cgit v1.2.3-70-g09d2