Hello guys! I've been learning Löve for a week to figure out if it could fit with my needs but I've get stuck when I've started to work with Tiled in a game that needs full resolution or simply scale for x2 the window.
function love.draw()
do
local scale = love.graphics.getWidth() / myGameScreenWidth
local scaleY = love.graphics.getHeight() / myGameScreenHeight
if scaleY < scale then scale = scaleY end
love.graphics.scale(scale)
end
-- the rest of your love.draw goes here
end
I'm wondering how you guys deal with these topics together. Are you using some lib? What would you recommend to an absolute beginner?
Also I want to know how to scale your game window to a double size. For example if your assets are made for 480x320 but you want to show the window at 960x640
you can set the window to whichever dimensions you want. I'm thinking you want to do a options menu where you can set the window size - just do this in place of where I did the setFullscreen call. Obviously, if you know set the width/height of the window, you don't have to get the window height/width like in the example, you'd do it like this
Maybe there could be different window size options you provide in a menu and you could put this code in a function and have the desiredWidth/height as arguments to the function.
That actually might be a nice bit of reusable code - if you create that, post it up here to share!