Skip to content

Commit 06a9771

Browse files
authored
Add canvas backdrop for canvas dimension visibility (#51)
Fixes #37
1 parent 90586c9 commit 06a9771

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

lib/term-ui.lua

+7
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,13 @@ function TermUI.drawCanvas(termContext, canvas, x, y)
77
end
88
end
99

10+
function TermUI.clear(termContext, char)
11+
for y = 1, termContext.height do
12+
termContext.setCursorPos(1, y)
13+
termContext.write(string.rep(char or " ", termContext.width))
14+
end
15+
end
16+
1017
TermUI.tests = {
1118
moduleLoads = function()
1219
assert(true, "This cannot fail.")

main.lua

+1-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ local function update(inputs)
5252
end
5353

5454
local function render()
55-
Term.clear()
55+
TermUI.clear(Term, "+")
5656

5757
if canvas then
5858
TermUI.drawCanvas(Term, canvas, canvasX + 1, canvasY + 1)

0 commit comments

Comments
 (0)