Touchbar breaks fullscreen on Android

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
Post Reply
Tearzz
Prole
Posts: 2
Joined: Sat Jan 27, 2018 8:04 pm

Touchbar breaks fullscreen on Android

Post 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.
Attachments
The default touchbar messing it all up.
The default touchbar messing it all up.
Activate-Touchbar.jpg (2.26 KiB) Viewed 2467 times
Right player is not at the right border.
Right player is not at the right border.
PONG.png (14.6 KiB) Viewed 2467 times
User avatar
Marty
Citizen
Posts: 89
Joined: Mon Dec 04, 2017 1:47 am
Location: Germany

Re: Touchbar breaks fullscreen on Android

Post 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.
Visual Studio Code TemplateRichLÖVE Mobile (AdMob+UnityAds+PlayGamesServices+GameCenter)Add me on Discord

───▄▀▀▀▄▄▄▄▄▄▄▀▀▀▄───
───█▒▒░░░░░░░░░▒▒█───
────█░░░░░░░░░█────
▄▄──█░░░▀█▀░░░█──▄▄
█░░█▀▄░░░░░░░▄▀█░░█
Post Reply

Who is online

Users browsing this forum: Google [Bot] and 53 guests