Hi!
I'm developing a simple game with Love the target platform is Android with the screen orientation to portrait but I can't imagine how to manage the scale of the screen.
Currently when I try the apk all the images are drawn in the lower left corner.
Screen resolution across multiple Android device
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
Re: Screen resolution across multiple Android device
I think this should work:
You may need to translate too, to centre the game screen.
However, if you use quads, see this caveat:
https://love2d.org/wiki/Quad
You may also want to use portland (a portrait/landscape handling library): https://love2d.org/forums/viewtopic.php?f=5&t=84810
Code: Select all
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
However, if you use quads, see this caveat:
https://love2d.org/wiki/Quad
You may also want to use portland (a portrait/landscape handling library): https://love2d.org/forums/viewtopic.php?f=5&t=84810
Re: Screen resolution across multiple Android device
Use libraries like CScreen if you are working with touch position
-
Who is online
Users browsing this forum: Ahrefs [Bot], Google [Bot] and 2 guests