verify responsive layout on 3 devices

This commit is contained in:
Kartik K. Agaram 2023-11-16 21:08:08 -08:00
parent 0f501a770f
commit aecb248626
2 changed files with 11 additions and 7 deletions

View File

@ -1,6 +1,6 @@
draw_next_button = function()
local w = App.width('next')
button(Buttons, 'next', {x=Safe_width-w-20, y=50, w=w+10, h=love.graphics.getFont():getHeight()+10, bg={r=0.6, g=0.8, b=0.6},
button(Buttons, 'next', {x=Safe_width-w-20, y=20, w=w+10, h=love.graphics.getFont():getHeight()+10, bg={r=0.6, g=0.8, b=0.6},
icon = function(p)
App.color{r=0, g=0, b=0}
love.graphics.print('next', p.x+5, p.y+5)

View File

@ -1,7 +1,11 @@
draw_status = function()
local w = App.width('check')
local x = Safe_width-w-20
local y = 50+love.graphics.getFont():getHeight()+150
local y = 20+love.graphics.getFont():getHeight()+50
if x < X+Square_side*2 + 50 then
-- window is too narrow; hope it's tall
y = Safe_height/2
end
button(Buttons, 'check', {x=x, y=y, w=w+10, h=love.graphics.getFont():getHeight()+10, bg={r=0.6, g=0.8, b=0.6},
icon = function(p)
App.color{r=0, g=0, b=0}
@ -11,14 +15,14 @@ draw_status = function()
Status = check_status()
end,
})
x = Safe_width-260
y = y+120
love.graphics.rectangle('line', x,y, 250,love.graphics.getFont():getHeight()+20)
y = y+love.graphics.getFont():getHeight()
if Status == 'yes' then
w = App.width('yes!')
App.color{r=0, g=0.6, b=0}
love.graphics.print('yes!', x+10, y+10)
love.graphics.print('yes!', Safe_width-w-10, y+10)
elseif Status == 'no' then
w = App.width('sorry')
App.color{r=1, g=0, b=0}
love.graphics.print('sorry', x+10, y+10)
love.graphics.print('sorry', Safe_width-w-10, y+10)
end
end