inline a function
This commit is contained in:
parent
33af1db102
commit
cb7a515d72
7
main.lua
7
main.lua
|
@ -55,17 +55,12 @@ end
|
|||
function initialize_default_settings()
|
||||
local font_height = 20
|
||||
love.graphics.setFont(love.graphics.newFont(font_height))
|
||||
local em = App.newText(love.graphics.getFont(), 'm')
|
||||
initialize_window_geometry(App.width(em))
|
||||
end
|
||||
|
||||
function initialize_window_geometry(em_width)
|
||||
-- maximize window
|
||||
love.window.setMode(0, 0) -- maximize
|
||||
App.screen.width, App.screen.height, App.screen.flags = love.window.getMode()
|
||||
-- shrink height slightly to account for window decoration
|
||||
App.screen.height = App.screen.height-100
|
||||
App.screen.width = 40*em_width
|
||||
App.screen.width = 40*App.width(App.newText(love.graphics.getFont(), 'm'))
|
||||
App.screen.flags.resizable = true
|
||||
App.screen.flags.minwidth = math.min(App.screen.width, 200)
|
||||
App.screen.flags.minheight = math.min(App.screen.width, 200)
|
||||
|
|
Loading…
Reference in New Issue