summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--img/better_disp.lua18
1 files changed, 17 insertions, 1 deletions
diff --git a/img/better_disp.lua b/img/better_disp.lua
index 33c4104..dbf52e9 100644
--- a/img/better_disp.lua
+++ b/img/better_disp.lua
@@ -20,4 +20,20 @@ local function vlorb(onc,offc, g1,g2,g3,g4,g5,g6)
return textc,bgc,string.char(vlorbchar)
end
-return {vlorb=vlorb}
+local function test()
+ term.clear()
+ local gs = {false,false,false,false,false,false}
+ while true do
+ term.setCursorPos(1,1)
+ local tc,bgc,char = vlorb(colors.red,colors.black, table.unpack(gs))
+ term.setTextColor(tc)
+ term.setBackgroundColor(bgc)
+ term.write(char)
+ local _,key = os.pullEvent"key"
+ if 65<=key and key<=70 then
+ local idx = key-64
+ gs[idx] = not gs[idx]
+ end
+ end
+
+return {vlorb=vlorb,test=test}