From 3145f6abee72ae31dd3721be1f02483c4c211b7a Mon Sep 17 00:00:00 2001 From: Troy Gilbert Date: Wed, 18 Dec 2013 15:56:29 -0600 Subject: [PATCH] Added support for foreground coloring to tile.js --- src/display/tile.js | 41 +++++++++++++++++++++++++++++++++++------ 1 file changed, 35 insertions(+), 6 deletions(-) diff --git a/src/display/tile.js b/src/display/tile.js index f5cbd76b..a123237f 100644 --- a/src/display/tile.js +++ b/src/display/tile.js @@ -6,6 +6,7 @@ ROT.Display.Tile = function(context) { ROT.Display.Rect.call(this, context); this._options = {}; + this._tileCache = {}; } ROT.Display.Tile.extend(ROT.Display.Rect); @@ -33,16 +34,44 @@ ROT.Display.Tile.prototype.draw = function(data, clearBefore) { if (!ch) { return; } + var fgColor = fg ? ROT.Color.fromString(fg) : false; + var chars = [].concat(ch); for (var i=0;i