Allow the window to be resized freely. (#8)

TODO: add option in config (#5) to set window size, and then save the current window size when resized so the next time you open the app, it opens at the same size you closed it with.
This commit is contained in:
smiegrin 2019-05-29 20:55:01 -05:00 committed by Joe Zeng
parent 0e7a2bb9fe
commit 1db0a0ef05

View File

@ -11,6 +11,9 @@ function love.load()
config["side_next"] = false
config["reverse_rotate"] = true
config["fullscreen"] = false
love.window.setMode(love.graphics.getWidth(), love.graphics.getHeight(), {resizable = true});
if not config.input then
config.input = {}
scene = InputConfigScene()
@ -61,7 +64,7 @@ end
function love.draw()
love.graphics.push()
if love.window.getFullscreen() then
-- get offset matrix
love.graphics.setDefaultFilter("linear", "nearest")
local width = love.graphics.getWidth()
@ -72,7 +75,7 @@ function love.draw()
(height - scale_factor * 480) / 2
)
love.graphics.scale(scale_factor)
end
scene:render()
love.graphics.pop()
end