renderChar method
void
renderChar(
- int x,
- int y,
- Char char
)
override
Render the given Char at column x
, row y
in a Terminal
Implementation
@override
void renderChar(int x, int y, Char char) {
// setup
ctx.textBaseline = 'top';
ctx.font = font;
// first render the background as a full block
ctx.fillStyle = char.background.cssColor;
ctx.fillText(String.fromCharCode(0x2588), x * charWidth, y * charHeight);
// then render the character
ctx.fillStyle = char.foreground.cssColor;
ctx.fillText(String.fromCharCode(char.charCode), x * charWidth,
y * charHeight, charWidth);
}