godotengine / godot

Godot Engine – Multi-platform 2D and 3D game engine
https://godotengine.org
MIT License
88.81k stars 20.14k forks source link

Games exported for iOS are not fullscreen/stretched despite the settings #94867

Open owlnewworlds opened 1 month ago

owlnewworlds commented 1 month ago

Tested versions

System information

Godot v4.3.rc1 - macOS 14.5.0 - Vulkan (Mobile) - integrated Apple M3 Pro - Apple M3 Pro (12 Threads)

Issue description

/!\ iOS exports seem to be broken in some cases /!\

I want to make an iOS version of my game which displays just fine on Android devices. But when I run the game from XCode on my iPad, it isn't fullscreen/stretched despite the project settings. I also tried a bunch of hacks found on Google but 1) it doesn't work better and 2) I don't like hacks :D

You will find attached two pictures, one from my own game and another one from a MRP.

WhatsApp Image 2024-07-27 at 23 45 03 WhatsApp Image 2024-07-28 at 11 02 43

Steps to reproduce

Minimal reproduction project (MRP)

Archive.zip

akien-mga commented 1 month ago

Does it work on 4.2.2?

CC @bruvzg

owlnewworlds commented 1 month ago

Does it work on 4.2.2?

CC @bruvzg

I can do the test if you like. I was working with 4.2.1 before but only when I was working on the Android version.

akien-mga commented 1 month ago

That would be helpful, as there are some improvements and fixes to platform support in each minor release, but it can happen that they introduce regressions. Knowing if this is "just" a bug or a regression in 4.3 would help figure out the proper fix.

bruvzg commented 1 month ago

You have integer viewport scaling enabled in the project settings, this is how it will look on any device unless it resolution exactly integer multiple of whatever you set in the setting.

bruvzg commented 1 month ago

Tested with RC1. With fractional scaling, it's covering all screen on iPad. With integer scaling it had black bars on both iPad and Mac, I have not checked whether all scaling calculations are correct, but it seems like expected behavior, and it's not iOS specific.

owlnewworlds commented 1 month ago

Never saw that on Android but if you say it's the expected behaviour, you're the boss, boss! ^^ I'm gonna try with fractional scaling.

I put integer because I read it was better for 2D pixel games even though my current game isn't one. So how are you supposed to display pixel perfect fullscreen on iPads ?

owlnewworlds commented 1 month ago

Tested with RC1. With fractional scaling, it's covering all screen on iPad. With integer scaling it had black bars on both iPad and Mac, I have not checked whether all scaling calculations are correct, but it seems like expected behavior, and it's not iOS specific.

It works! <3 Thank you

owlnewworlds commented 1 month ago

Just a tiny related question: Window.min_size can only be set through code?