writeAt method
Writes text
starting at column x
, row y
using fore
as the text
color and back
as the background color.
Implementation
void writeAt(int x, int y, String text, [Color? fore, Color? back]) {
fore ??= foreColor;
back ??= backColor;
// TODO: Bounds check.
for (var i = 0; i < text.length; i++) {
if (x + i >= width) break;
drawGlyph(x + i, y, Glyph.fromCharCode(text.codeUnitAt(i), fore, back));
}
}