UNPKG

@erikyuzwa/rogue-punk

Version:

a JavaScript library to help you build your roguelike adventures

31 lines (30 loc) 707 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.Glyph = void 0; class Glyph { constructor(options) { options = options || {}; this.char = options.character || ' '; this.fgColor = options.fgColor || 'white'; this.bgColor = options.bgColor || 'black'; } getChar() { return this.char; } getBgColor() { return this.bgColor; } getFgColor() { return this.fgColor; } toString() { return '%c{' + this.fgColor + '}%b{' + this.bgColor + '}' + this.char + '%c{white}%b{black}'; } } exports.Glyph = Glyph;