HUD Position on Android Phone is Incorrect

This is a screenshot from my Motorola Moto G7 phone running Android 9. The HUD is position too low. I have tried modifying the code to include screen scale into computing the location into positioning the HUD as we do for iPhones. It moves up about a 1/4 of an inch (the screen scale on this phone is about 1.3). Is there a fix to position the HUD on Android?

Hi,

I had a similar post and i wonder that if sometimes the safe space area is reported incorrectly on some phones.
I am yet to find a solution that accurately solves this issue.
@OboShape not sure if you have done much in the way of Mobile Development with Godot before but any ideas would be appreciated.

not got to the course as yet, only had limited tests with android on godot.
what ill do tonight if i can, ill download the repo to this lecture and have a play with an emulator.

ill see if i can get an emulator for that device and test at this point.

would i be right in saying it looks ok on the iphone?

might be clutching at straws until i catch up, any chance i could see the code you have for trying to scale on android please.

looking at the ratios, any iphone above 11 have a 9:19.5, but the G7 from what ive read has a 9 : 19 not sure if that plays a part in setting the safe area at all.

EDIT : didnt manage to get it downloaded, internet access for me this evening is pretty poor, ill try again tomorrow.

darren

Wondering if there’s something in this post I seen that might help.
It’s for a Pixel 6 and 7, but might offer an insight into what could be tweaked

Following your example for a Pixel phone, I found for my Motorola moto g(7) that the pixelMargin has to be -65. The g(7) has a deep notch in the center of the screen for the camera. If we were to publish a game with a HUD on the Google Store, we need a solution that would work for all phones. The code for iPhones works perfectly for all iPhones that I have tested.

1 Like

Cool. I seen in that other example I seen, they managed to get the phone type and set it based on that.

I’ll have a dig around when I finish work to see if there’s a way of either polling it from device, or getting a sort of utility script that can query a list or a database.

See what I can find.

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.

Privacy & Terms