How to have different orientations depending on device?

Hello :slight_smile:

I would like to have my project to deploy on iPhones in portrait aspect ratio and on iPads in landscape.

I have the Project->Display set like this

And a custom display profiles file as follow:


However even though the landscape profile has exact same resolution of the iPad, it launches the game always in portrait mode on iPad too.

Any suggestions? Something I’m missing?

EDIT:
If I set in project settings “dynamic orientation”, then both layouts seems working fine when rotating the devices. But I’d need to have fixed orientations but always portrait for phones and landscape for ipads, if that makes sense :slight_smile:

If you need to lock it I believe you also need to specify the device in the profiles

A comma separated list of device models. The device model matches the start of the device model name, e.g. iPhone10 will match “iPhone10,*” models. Model names with commas should be enclosed in quotes, i.e. "iPhone10,3", "iPhone10,6" matches iPhone X models (see Models - The iPhone Wiki). Note that the only platforms reporting a device model when calling sys.get_sys_info() is Android and iOS. Other platforms return an empty string and will therefore never pick a display profile that has a device model qualifier.

Thanks for the reply ! Tried that too, but it seems not making much difference unfortunately

Would it be possible to get the screen size with window.get_size() and adjust the game accordingly?

One way would be to build using bob.jar, and use different settings files for each platform. E.g. using “–settings=ipad.ini” vs “–settings=iphone.ini”, and have the display settings set accordingly in each settings file.

1 Like

Thanks for the suggestion :slight_smile: I’m not familiar with bob command, I will have a look… though it seems like that’s a solution for just testing?
For a real distribution or even a TestFlight build/bundle it wouldn’t work? From the little I saw it seems bob would make 2 separate builds/bundles… one with “iphone” settings and one with “iPad” settings?