Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

t.window.resizble = false doesn't work on android with LOVE 12 #2060

Open
FloridaMen opened this issue Apr 23, 2024 · 5 comments
Open

t.window.resizble = false doesn't work on android with LOVE 12 #2060

FloridaMen opened this issue Apr 23, 2024 · 5 comments
Labels
12.0 Android more info needed Further information is needed from the user

Comments

@FloridaMen
Copy link

When writing t.window.resizable = false in conf.lua, then compiling (with apktool) and running the app on my phone (nothing phone 1) it will rotate between portrait and landscape mode as if t.window.resizable was true. Additionally, it ignores my phone's auto-rotate off toggle, and rotates even when it is disabled (when no app should rotate at all).

@MikuAuahDark MikuAuahDark added bug Something isn't working 12.0 Android labels Apr 23, 2024
@MikuAuahDark
Copy link
Contributor

MikuAuahDark commented Apr 24, 2024

I seem unable to reproduce this behavior in LOVE 12 with "embed" mode.

main.lua

function love.draw()
	local x, y, w, h = love.window.getSafeArea()
	love.graphics.setLineWidth(20)
	love.graphics.rectangle("line", x, y, w, h)
	love.graphics.print(string.format("%dx%d+%d+%d\n%s", x, y, w, h, love.window.getDisplayOrientation()), 100, 100)
end

conf.lua

function love.conf(t)
	t.window.resizable = false
	t.window.fullscreen = false
end

@MikuAuahDark MikuAuahDark added more info needed Further information is needed from the user and removed bug Something isn't working labels Apr 24, 2024
@FloridaMen
Copy link
Author

here's my conf.lua

function love.conf(t)
    t.console = false
    t.accelerometerjoystick = false
    t.window.highdpi = true
    t.window.width = 2
    t.window.height = 1
    t.window.resizable = false
end 

I'll try and use the example you gave, perhaps the issue is with my phone's specific implementation of auto-rotate?? I don't really know what I'm talking about though, honestly

@FloridaMen
Copy link
Author

I just noticed you were using t.window.resizalbe = true. Does this stop the app from rotating? Because if that's the case then the issue is in the wiki:

If set to true this allows the user to resize the game's window. In version 11.4 and later for Android, this also allows changing orientation between landscape and portrait.

Personally I take this to mean that if set to false, it should prevent changing orientation between landscape and portrait, but perhaps I'm interpreting this incorrectly.

@MikuAuahDark
Copy link
Contributor

Oh yeah, the code I pasted was wrong because I was testing if t.window.resizable = true does what it expects. t.window.resizable = false should lock orientation while keeping the aspect ratio (can only rotate in landscale), while t.window.resizable = true allows it to go from landscape to portrait.

Still, with my original testing, I can't reproduce the issue. I'll take a look at your provided conf.lua tomorrow.

@FloridaMen
Copy link
Author

FloridaMen commented Apr 24, 2024

Just tested the following configs to see if highdpi or fullscreen had an effect (none of them functioned as intended for me):

function love.conf(t)
    t.console = false
    t.accelerometerjoystick = false
    t.window.highdpi = true
    t.window.width = 2
    t.window.height = 1
    t.window.resizable = false
    t.window.fullscreen = false
end 
function love.conf(t)
    t.console = false
    t.accelerometerjoystick = false
    t.window.highdpi = false
    t.window.width = 2
    t.window.height = 1
    t.window.resizable = false
    t.window.fullscreen = false
end
function love.conf(t)
    t.console = false
    t.accelerometerjoystick = false
    t.window.highdpi = true
    t.window.width = 2
    t.window.height = 1
    t.window.resizable = true
    t.window.fullscreen = true
end 

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
12.0 Android more info needed Further information is needed from the user
Projects
None yet
Development

No branches or pull requests

2 participants