love2d / love-android

Android build setup for LÖVE.
https://love2d.org
Other
198 stars 70 forks source link

Switching screen orientation doesn't work/is buggy #196

Closed IsometricShahil closed 3 years ago

IsometricShahil commented 3 years ago

As mentioned in the FaQ, I tried to get portrait mode in löve with conf.lua, I tried many width/height combinations where height > width but it doesn't seem to work at all. Here is one of the tried conf.lua:

function love.conf(t)
  t.window.width = 100
  t.window.height = 200
  t.window.fullscreen = true
  t.window.resizable = false
end

Edit: It seems like updateMode doesn't work either, fortunately setMode seems to work perfectly so I will use that for now

MikuAuahDark commented 3 years ago

Alright looks like there's some conflicts going on here.

I tested both the love2d.org-provided APK vs. master branch and I can reproduce it with both APKs. It seems can't properly set orientation to portrait if you set t.window.fullscreen = true at love.conf. The t.window.resizable = false is needed there to prevent the game change orientation so that's fine.

A workaround exist by setting the t.window.fullscreen = false at love.conf then calling love.window.setFullscreen(true) at love.load.

I need to think a way to fix this.