The phone I'm using is a Galaxy A9 Pro 2016 with a display of 1920x1080, but the Löve app is running on a 731x411 resolution
I've tried using the love.window.setMode and love.conf to no avail, even though setMode returns true. I have no idea why this is happening, considering it used to run just fine on this same phone.
Has anyone else experienced this? Is it a native bug? Is there anything I could do to fix it?
Löve for Android runs on a different resolution than the native one
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
Re: Löve for Android runs on a different resolution than the native one
This is, unfortunately, not a bug. The coordinates/dimensions are no longer in pixels when highdpi is on, and it's forced to on in Android. Even worse, for some reason, the returned size is rounded, making calculations inaccurate. The real pixel dimensions can be obtained with love.graphics.getPixelDimensions (or ...Width/...Height, see See Also section), and can be converted to coordinates using love.window.fromPixels.
There's been quite some discussion about providing a way to disable this, to no avail, see viewtopic.php?f=4&t=86215.
There's been quite some discussion about providing a way to disable this, to no avail, see viewtopic.php?f=4&t=86215.
Re: Löve for Android runs on a different resolution than the native one
I'm not sure if I understand?
Using getPixelDimensions I got the actual resolution of my display, but from the looks of it I'm still limited to only 731x411 pixels on the screen (I see some pixel rounding errors). I'm used to making my games adaptive to all screen sizes so making it DPI scalable doesn't help me at all. Reading the linked thread didn't give me any concrete answers and even when rendered to a canvas I'm still limited to a small resolution.
Using getPixelDimensions I got the actual resolution of my display, but from the looks of it I'm still limited to only 731x411 pixels on the screen (I see some pixel rounding errors). I'm used to making my games adaptive to all screen sizes so making it DPI scalable doesn't help me at all. Reading the linked thread didn't give me any concrete answers and even when rendered to a canvas I'm still limited to a small resolution.
Re: Löve for Android runs on a different resolution than the native one
I think you're confusing coordinates with pixels. You don't only have 731x411 pixels accessible. The maximum coordinates of the screen are 731 point something and 411 point something; you can use love.window.fromPixels(love.graphics.getPixelWidth()) and ...Height()) to find out the exact values, because the numbers returned by getDimensions() are rounded.
That doesn't mean you only have 731 pixels available horizontally; it just means that the coordinates don't match the pixels, but using fractional coordinates you can access all the pixels. For example, to draw a pixel on the bottom right corner of the screen you can use:
As for canvases, they're affected too. For example, if you use the settings version of love.graphics.newCanvas to set the dpiscale value of the canvas to 1, you can specify the width and height directly in pixels.
That doesn't mean you only have 731 pixels available horizontally; it just means that the coordinates don't match the pixels, but using fractional coordinates you can access all the pixels. For example, to draw a pixel on the bottom right corner of the screen you can use:
Code: Select all
local fp = love.window.fromPixels
love.graphics.rectangle("fill", fp(1919), fp(1079), fp(1), fp(1))
Who is online
Users browsing this forum: Ahrefs [Bot], Bing [Bot] and 15 guests