Basic sitemode

This commit is contained in:
2023-09-22 21:08:03 -07:00
parent 76e92a2a50
commit e3e43f0223
17 changed files with 568 additions and 15 deletions

View File

@ -18,12 +18,20 @@ class Cursor {
t._tiles = [for (var i = 0; i < nTiles; i += 1) Tile()];
}
void putc(int c) {
void putc(int? c) {
for (var dx = 0; dx < font.cellWidth; dx += 1) {
for (var dy = 0; dy < font.cellHeight; dy += 1) {
var i = t._fromXY(x + dx, y + dy);
if (i != null) {
// you can pass null and in that case a character-sized block of
// screen is automatically UI-affected, but not drawn
if (c == null) {
t._tiles[i].highlightGroup = highlightGroup;
t._tiles[i].actions.addAll(_acts);
continue;
}
final (sourceCx, sourceCy) = (
(c % font.nCellsW) * font.cellWidth + dx,
(c ~/ font.nCellsW) * font.cellHeight + dy
@ -48,6 +56,13 @@ class Cursor {
}
}
void touch(int n) {
for (var i = 0; i < n; i++) {
putc(null);
x += font.cellWidth;
}
}
void puts(String s) {
var startX = x;
for (final c in toCp437String(s)) {