some nascent facility for debug UIs

This commit is contained in:
Kartik K. Agaram 2023-10-22 12:30:37 -07:00
parent d22d2c34fa
commit c26e684b41
4 changed files with 20 additions and 2 deletions

View File

@ -90,6 +90,12 @@ on.keychord_press = function(chord, key)
elseif chord == 'S-right' then
Viewport.x = Viewport.x + App.screen.width/Viewport.zoom
B()
elseif chord == 'M-1' then
if Debug_draw_fn ~= draw_debug_ui1 then
Debug_draw_fn = draw_debug_ui1
else
Debug_draw_fn = nil
end
end
end
end
end

View File

@ -34,4 +34,7 @@ on.draw = function()
draw_test_failure_indicator()
draw_ticks()
draw_menu_bar()
end
if Debug_draw_fn then
Debug_draw_fn()
end
end

8
0113-draw_debug_ui1 Normal file
View File

@ -0,0 +1,8 @@
draw_debug_ui1 = function()
local x, y = App.screen.width/3, App.screen.height/3
local w, h = App.screen.width/3, App.screen.height/3
App.color{r=1, g=1, b=1}
love.graphics.rectangle('fill', x,y, w, h)
App.color{r=0, g=0, b=0}
love.graphics.rectangle('line', x+10, y+10, w-20, h-20, 5,5)
end

1
0114-Debug_draw_fn Normal file
View File

@ -0,0 +1 @@
Debug_draw_fn = nil