bSupportsUpsideDownOrientation

bSupportsUpsideDownOrientation

#Overview

name: bSupportsUpsideDownOrientation

The value of this variable can be defined or overridden in .ini config files. 1 .ini config file referencing this setting variable.

It is referenced in 5 C++ source files. Also referenced in 2 C# build files meaning it may affect the build system logic.

#Summary

#Usage in the C++ source code

The purpose of bSupportsUpsideDownOrientation is to specify whether the iOS application supports the upside-down portrait orientation. This setting is part of the device orientation configuration for iOS applications developed using Unreal Engine 5.

This setting variable is primarily used in the iOS-specific modules of Unreal Engine, including the IOSRuntimeSettings, IOSPlatformEditor, and ApplicationCore subsystems. It’s particularly relevant for configuring the supported orientations of an iOS app built with Unreal Engine.

The value of this variable is typically set in the project’s configuration files, specifically in the section “/Script/IOSRuntimeSettings.IOSRuntimeSettings” of the engine’s INI file (GEngineIni). It can be modified through the Unreal Engine editor’s project settings for iOS.

This variable interacts with other orientation-related variables such as bSupportsPortraitOrientation, bSupportsLandscapeLeftOrientation, and bSupportsLandscapeRightOrientation. Together, these variables determine the allowed orientations for the iOS app.

Developers must be aware that:

  1. This setting specifically affects the upside-down portrait orientation, which is distinct from the standard portrait orientation.
  2. Changing this setting may impact the user experience and how the app behaves when the device is rotated.
  3. At least one orientation must be supported; the engine enforces this by automatically enabling portrait orientation if all orientations are disabled.

Best practices when using this variable include:

  1. Consider the design and user experience of your app when deciding which orientations to support.
  2. Ensure that your app’s UI and gameplay elements work correctly in all supported orientations.
  3. Test the app thoroughly in all enabled orientations to verify proper functionality and appearance.
  4. Be mindful of Apple’s guidelines and requirements regarding supported orientations for different types of apps and devices.
  5. Coordinate this setting with your app’s overall design and any orientation-specific logic in your game code.

#Setting Variables

#References In INI files

Location: <Workspace>/Engine/Config/BaseEngine.ini:2981, section: [/Script/IOSRuntimeSettings.IOSRuntimeSettings]

#References in C++ code

#Callsites

This variable is referenced in the following C++ source code:

#Loc: <Workspace>/Engine/Source/Developer/IOS/IOSPlatformEditor/Private/IOSTargetSettingsCustomization.cpp:801

Scope: file

Source code excerpt:

	SETUP_PLIST_PROP(VersionInfo, BundleCategory);
	SETUP_PLIST_PROP(bSupportsPortraitOrientation, OrientationCategory);
	SETUP_PLIST_PROP(bSupportsUpsideDownOrientation, OrientationCategory);
	SETUP_PLIST_PROP(bSupportsLandscapeLeftOrientation, OrientationCategory);
	SETUP_PLIST_PROP(bSupportsLandscapeRightOrientation, OrientationCategory);
	SETUP_PLIST_PROP(PreferredLandscapeOrientation, OrientationCategory);
	
	SETUP_PLIST_PROP(bSupportsITunesFileSharing, FileSystemCategory);
	SETUP_PLIST_PROP(bSupportsFilesApp, FileSystemCategory);

#Loc: <Workspace>/Engine/Source/Editor/PIEPreviewDeviceProfileSelector/Private/PIEPreviewDevice.cpp:214

Scope (from outer to inner):

file
function     void FPIEPreviewDevice::DetermineScreenOrientationRequirements

Source code excerpt:

		{
			bool bSupportsPortraitOrientation;
			bool bSupportsUpsideDownOrientation;
			bool bSupportsLandscapeLeftOrientation;
			bool bSupportsLandscapeRightOrientation;
			GConfig->GetBool(TEXT("/Script/IOSRuntimeSettings.IOSRuntimeSettings"), TEXT("bSupportsPortraitOrientation"), bSupportsPortraitOrientation, GEngineIni);
			GConfig->GetBool(TEXT("/Script/IOSRuntimeSettings.IOSRuntimeSettings"), TEXT("bSupportsUpsideDownOrientation"), bSupportsUpsideDownOrientation, GEngineIni);
			GConfig->GetBool(TEXT("/Script/IOSRuntimeSettings.IOSRuntimeSettings"), TEXT("bSupportsLandscapeLeftOrientation"), bSupportsLandscapeLeftOrientation, GEngineIni);
			GConfig->GetBool(TEXT("/Script/IOSRuntimeSettings.IOSRuntimeSettings"), TEXT("bSupportsLandscapeRightOrientation"), bSupportsLandscapeRightOrientation, GEngineIni);
			bNeedPortrait = bSupportsPortraitOrientation || bSupportsUpsideDownOrientation;
			bNeedLandscape = bSupportsLandscapeLeftOrientation || bSupportsLandscapeRightOrientation;
		}
		break;
	}
}

#Loc: <Workspace>/Engine/Source/Runtime/ApplicationCore/Private/IOS/IOSAppDelegate.cpp:1155

Scope: file

Source code excerpt:

	else
	{
		GConfig->GetBool(TEXT("/Script/IOSRuntimeSettings.IOSRuntimeSettings"), TEXT("bSupportsUpsideDownOrientation"), bSupportsPortraitUpsideDown, GEngineIni);
		GConfig->GetBool(TEXT("/Script/IOSRuntimeSettings.IOSRuntimeSettings"), TEXT("bSupportsLandscapeLeftOrientation"), bSupportsLandscapeLeft, GEngineIni);
		GConfig->GetBool(TEXT("/Script/IOSRuntimeSettings.IOSRuntimeSettings"), TEXT("bSupportsLandscapeRightOrientation"), bSupportsLandscapeRight, GEngineIni);
	}
	
	UIInterfaceOrientationMask Mask = 0;
	if (bSupportsPortrait)

#Loc: <Workspace>/Engine/Source/Runtime/IOS/IOSRuntimeSettings/Classes/IOSRuntimeSettings.h:368

Scope (from outer to inner):

file
class        class UIOSRuntimeSettings : public UObject

Source code excerpt:

	// Supports upside down portrait orientation. Landscape will not be supported.
	UPROPERTY(GlobalConfig, EditAnywhere, Category = DeviceOrientations)
	uint32 bSupportsUpsideDownOrientation : 1;

	// Supports left landscape orientation. Portrait will not be supported.
	UPROPERTY(GlobalConfig, EditAnywhere, Category = DeviceOrientations)
	uint32 bSupportsLandscapeLeftOrientation : 1;

	// Supports right landscape orientation. Portrait will not be supported.

#Loc: <Workspace>/Engine/Source/Runtime/IOS/IOSRuntimeSettings/Private/IOSRuntimeSettings.cpp:81

Scope (from outer to inner):

file
function     void UIOSRuntimeSettings::PostEditChangeProperty

Source code excerpt:


	// Ensure that at least one orientation is supported
	if (!bSupportsPortraitOrientation && !bSupportsUpsideDownOrientation && !bSupportsLandscapeLeftOrientation && !bSupportsLandscapeRightOrientation)
	{
		bSupportsPortraitOrientation = true;
		UpdateSinglePropertyInConfigFile(GetClass()->FindPropertyByName(GET_MEMBER_NAME_CHECKED(UIOSRuntimeSettings, bSupportsPortraitOrientation)), GetDefaultConfigFilename());
	}

	// Ensure that at least one API is supported

#References in C# build files

This variable is referenced in the following C# build files:

Location: <Workspace>/Engine/Source/Programs/UnrealBuildTool/Platform/IOS/UEDeployIOS.cs:566

			bool bSupportsPortrait = bSupported;

			Ini.GetBool("/Script/IOSRuntimeSettings.IOSRuntimeSettings", "bSupportsUpsideDownOrientation", out bSupported);
			SupportedOrientations += bSupported ? "\t\t<string>UIInterfaceOrientationPortraitUpsideDown</string>\n" : "";
			bSupportsPortrait |= bSupported;

			bool bSupportsLandscapeLeft = false;
			Ini.GetBool("/Script/IOSRuntimeSettings.IOSRuntimeSettings", "bSupportsLandscapeLeftOrientation", out bSupportsLandscapeLeft);
			bool bSupportsLandscapeRight = false;

Location: <Workspace>/Engine/Source/Programs/UnrealBuildTool/Platform/IOS/UEDeployIOS.cs:233

			bool bSupportsPortrait = bSupported;

			Ini.GetBool("/Script/IOSRuntimeSettings.IOSRuntimeSettings", "bSupportsUpsideDownOrientation", out bSupported);
			SupportedOrientations += bSupported ? "\t\t<string>UIInterfaceOrientationPortraitUpsideDown</string>\n" : "";
			bSupportsPortrait |= bSupported;

			bool bSupportsLandscapeLeft = false;
			Ini.GetBool("/Script/IOSRuntimeSettings.IOSRuntimeSettings", "bSupportsLandscapeLeftOrientation", out bSupportsLandscapeLeft);
			bool bSupportsLandscapeRight = false;