Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

iOS export is confusing around handling of orientation (configurable both in project settings and export preset) #45422

Closed
samtsejerome opened this issue Jan 24, 2021 · 9 comments · Fixed by #48939

Comments

@samtsejerome
Copy link

Godot version:
3.2.3 Mono official build.

OS/device including version:
macbook Pro running catalina 10.15,6

Issue description:
have tried with several simple projects and the .ipa isn'tcreated (see issue 45421)
but when running the xcode project produced the graphics in the start scene are displayed sideways

see screenshots:
project in editor:
editor-sshot

same project in iphone simulator:
orientation-sshot

steps to reproduce:

  1. create a simple project with a viewport that should fit any modern iphone display.
  2. select export... from the project menu.
  3. select the ios(Runnable) preset
  4. enter a valid team id, and bundle id
  5. select the export path to a location outside of the project.
  6. select all the required icons, and screens as per the documentation.
  7. click the export Project button, enter an ipa filename and click save.
  8. open the project in xcode.

expected results:
images displayed in the viewport should look as they do when running in godot

actual results:
ithe entire viewport isrotated ro

tated 90 degrees

Minimal reproduction project:

csharptest_project3.zip

@Calinou
Copy link
Member

Calinou commented Jan 24, 2021

You need to set the orientation to Portrait in the Project Settings, as landscape orientation is used by default.

@samtsejerome
Copy link
Author

@samtsejerome
Copy link
Author

i did a quick retry setting the orientation to portrait, but then got an error! (screenshot attached)

exporterror-sshot

@naithar
Copy link
Contributor

naithar commented Jan 29, 2021

MRP project export is fixed by adding icons and LauchScreen images as described in #45421 (comment)

Incorrect orientation is fixed by selecting correct orientation in Project Settings->Display->Window->Handheld->Orientation right now you have landscape value, so that's what iOS project is using.
It can also be fixed by selecting required orientations on export screen, but the one selected in Project Settings has more priority and should be also selected correctly.

@neikeq
Copy link
Contributor

neikeq commented May 21, 2021

I don't think this is specific to Mono/C# projects. Can any one confirm?

@naithar
Copy link
Contributor

naithar commented May 21, 2021

I don't think this is specific to Mono/C# projects. Can any one confirm?

It's not. The reason for this issue is the incorrect orientation in project and export settings.

@akien-mga
Copy link
Member

Should we remove the parameters from the export preset, and improve documentation? I think something similar was done for Android.

@akien-mga akien-mga changed the title mono iOs export produces wrong orientation. iOS export is confusing around handling of orientation (configurable both in project settings and export preset) May 21, 2021
@naithar
Copy link
Contributor

naithar commented May 21, 2021

If we can get access to ProjectSettings::get_singleton()->get("display/window/handheld/orientation") inside export preset code, it should be pretty simple. As far as I can tell that's exactly what Android does.

@Calinou
Copy link
Member

Calinou commented May 21, 2021

The screen orientation has been defined as a string since Godot was open sourced. For 4.0, I think it's time to move to an enum 🙂

We'll need a different PR to fix this in the 3.x branch, as we need to keep the string there to preserve compatibility with existing projects. (Nothing major needs to be changed by the users, but people may still be surprised to see their project revert to the default orientation after upgrading.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants