Page 1 of 1

Touchbar breaks fullscreen on Android

Posted: Sun Jan 28, 2018 7:23 pm
by Tearzz
Hello!
I've been getting my game from Windows to Android, and it works!
But there is just one problem.

This is what I use to make it fullscreen and then get the monitor / screen / device dimensions.

Code: Select all

love.window.setMode(0, 0, {fullscreen=true, borderless=true})
screen_width = love.graphics.getWidth()
screen_height = love.graphics.getHeight()
I then have some coordinates for the first player and second player.

Code: Select all

player_width = 20
player_1.x = 0 --left
player_2.x = screen_width - player_width --right
On Windows it does it perfectly, but on Android the little touchbar works like a border on the screen... How can I prevent this from happening and let player_2 go all the way out to the right.

My current thought is to make a "fake" loading screen that waits a few seconds and then set the screen sizes and everything, but I imagine that there's a better way of doing it.

Re: Touchbar breaks fullscreen on Android

Posted: Fri Aug 31, 2018 2:00 pm
by Marty
This is a late reply, but the reason why the soft buttons cause this issue is on game start your fullscreen is false and you change fullscreen to true later on.

When changing fullscreen to true, it won't trigger the window resize event on Android, thus the dimensions are not updated.

Just do

Code: Select all

t.window.fullscreen = love._os == "Android" or love._os == "iOS"
in your conf.lua and it will solve this issue.