allow the window to be resized
This still isn't ideal. On my Linux laptop for some reason the window receives a signal to maximize itself soon after (but sometime after) the program starts.
This commit is contained in:
parent
bc46cef4e5
commit
33ea91f8d9
15
main.lua
15
main.lua
|
@ -87,11 +87,14 @@ function App.initialize(arg)
|
|||
|
||||
-- maximize window
|
||||
love.window.setMode(0, 0) -- maximize
|
||||
App.screen.width, App.screen.height = love.window.getMode()
|
||||
App.screen.width, App.screen.height, App.screen.flags = love.window.getMode()
|
||||
-- shrink slightly to account for window decoration
|
||||
App.screen.width = App.screen.width-100
|
||||
App.screen.height = App.screen.height-100
|
||||
love.window.setMode(App.screen.width, App.screen.height)
|
||||
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)
|
||||
love.window.updateMode(App.screen.width, App.screen.height, App.screen.flags)
|
||||
|
||||
initialize_font_settings(20)
|
||||
|
||||
|
@ -110,6 +113,14 @@ function App.initialize(arg)
|
|||
|
||||
end -- App.initialize
|
||||
|
||||
function love.resize(w, h)
|
||||
--? print(("Window resized to width: %d and height: %d."):format(w, h))
|
||||
App.screen.width, App.screen.height = w, h
|
||||
Line_width = math.min(40*App.width(Em), App.screen.width-50)
|
||||
-- Should I Text.redraw_all() here to reset text fragments? It doesn't seem
|
||||
-- to be needed, based on repeatedly resizing the window up and down.
|
||||
end
|
||||
|
||||
function initialize_font_settings(font_height)
|
||||
Font_height = font_height
|
||||
love.graphics.setFont(love.graphics.newFont(Font_height))
|
||||
|
|
Loading…
Reference in New Issue