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