responsive layout

This commit is contained in:
Kartik K. Agaram 2023-11-16 12:32:33 -08:00
parent 76cfb90d8c
commit ce363a8245
3 changed files with 12 additions and 3 deletions

View File

@ -1,7 +1,5 @@
on.initialize = function()
math.randomseed(os.time())
Font_size = Square_side*0.8
Padding = (Square_side-Font_size)/2
love.graphics.setFont(love.graphics.newFont(Font_size))
initialize_layout()
new()
end

8
0033-initialize_layout Normal file
View File

@ -0,0 +1,8 @@
initialize_layout = function()
X = App.screen.width/4
Y = App.screen.height/4
Square_side = math.min(App.screen.width/5, App.screen.height/5, 100)
Font_size = Square_side*0.8
love.graphics.setFont(love.graphics.newFont(Font_size))
Padding = (Square_side-Font_size)/2
end

3
0034-on.resize Normal file
View File

@ -0,0 +1,3 @@
on.resize = function()
initialize_layout()
end