NewWindowHeight
NewWindowHeight
#Overview
name: NewWindowHeight
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 10
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of NewWindowHeight is to set the height of the new viewport window in pixels when launching a Play In Editor (PIE) session in Unreal Engine 5. It is primarily used for configuring the game viewport settings during development and testing.
This setting variable is mainly relied upon by the Unreal Engine’s Editor subsystem, specifically in the LevelEditor and PlayInEditor modules. It’s used in conjunction with other related settings to define the size and position of the game window when playing in the editor.
The value of this variable is typically set in the project settings, specifically in the “Play” section of the editor preferences. It can also be modified programmatically, as seen in the FInEditorCapture::OverridePlaySettings
function.
NewWindowHeight interacts closely with other variables such as NewWindowWidth, NewWindowPosition, and CenterNewWindow. These variables work together to define the dimensions and placement of the PIE window.
Developers should be aware that:
- The value is clamped to a minimum of 0, where 0 means to use the desktop’s screen resolution.
- Changes to this value may affect the game’s rendering and UI scaling.
- It’s used in calculations for safe zones and device emulation.
Best practices when using this variable include:
- Ensuring it’s set to an appropriate value for the target platform and resolution.
- Considering it in conjunction with NewWindowWidth to maintain the desired aspect ratio.
- Testing the game at various window sizes to ensure proper scaling and layout of UI elements.
- Being mindful of how changes to this value might affect performance, especially on lower-end systems.
#Setting Variables
#References In INI files
Location: <Workspace>/Engine/Config/BaseEditorPerProjectUserSettings.ini:225, section: [/Script/UnrealEd.LevelEditorPlaySettings]
- INI Section:
/Script/UnrealEd.LevelEditorPlaySettings
- Raw value:
720
- Is Array:
False
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Editor/MovieSceneCaptureDialog/Private/MovieSceneCaptureDialogModule.cpp:479
Scope (from outer to inner):
file
function void FInEditorCapture::OverridePlaySettings
Source code excerpt:
PlayInEditorSettings->NewWindowWidth = Settings.Resolution.ResX;
PlayInEditorSettings->NewWindowHeight = Settings.Resolution.ResY;
PlayInEditorSettings->CenterNewWindow = false;
PlayInEditorSettings->NewWindowPosition = FIntPoint::NoneValue; // It will center PIE to the middle of the screen the first time it is run (until the user drag the window somewhere else)
PlayInEditorSettings->LastExecutedPlayModeType = EPlayModeType::PlayMode_InEditorFloating;
// Reset everything else
PlayInEditorSettings->GameGetsMouseControl = false;
#Loc: <Workspace>/Engine/Source/Editor/UnrealEd/Classes/Settings/LevelEditorPlaySettings.h:297
Scope (from outer to inner):
file
class class ULevelEditorPlaySettings : public UObject
Source code excerpt:
/** The height of the new view port window in pixels (0 = use the desktop's screen resolution). */
UPROPERTY(config, EditAnywhere, Category=GameViewportSettings, meta=(ClampMin=0))
int32 NewWindowHeight;
/** The position of the new view port window on the screen in pixels. */
UPROPERTY(config, EditAnywhere, Category = GameViewportSettings)
FIntPoint NewWindowPosition;
/** Whether the new window should be centered on the screen. */
#Loc: <Workspace>/Engine/Source/Editor/UnrealEd/Private/PlayLevel.cpp:620
Scope (from outer to inner):
file
function void UEditorEngine::EndPlayMap
Source code excerpt:
PlaySettingsConfig->NewWindowPosition = PlaySettingsConfig->MultipleInstancePositions[WindowIndex];
PlaySettingsConfig->NewWindowWidth = PlaySettingsConfig->LastSize.X;
PlaySettingsConfig->NewWindowHeight = PlaySettingsConfig->LastSize.Y;
}
}
}
PlaySettingsConfig->PostEditChange();
PlaySettingsConfig->SaveConfig();
#Loc: <Workspace>/Engine/Source/Editor/UnrealEd/Private/PlayLevel.cpp:2920
Scope (from outer to inner):
file
function void UEditorEngine::StartPlayInEditorSession
Source code excerpt:
SafeZoneRatio.Left /= (EditorPlaySettings->NewWindowWidth / 2.0f);
SafeZoneRatio.Right /= (EditorPlaySettings->NewWindowWidth / 2.0f);
SafeZoneRatio.Bottom /= (EditorPlaySettings->NewWindowHeight / 2.0f);
SafeZoneRatio.Top /= (EditorPlaySettings->NewWindowHeight / 2.0f);
FSlateApplication::Get().OnDebugSafeZoneChanged.Broadcast(SafeZoneRatio, false);
}
{
// Temporarily set this information until the deprecated variables are removed.
PRAGMA_DISABLE_DEPRECATION_WARNINGS
#Loc: <Workspace>/Engine/Source/Editor/UnrealEd/Private/PlayLevel.cpp:3571
Scope (from outer to inner):
file
function void UEditorEngine::GetWindowSizeAndPositionForInstanceIndex
Source code excerpt:
if (InWorldContext.bIsPrimaryPIEInstance)
{
OutSize = FIntPoint(InEditorPlaySettings.NewWindowWidth, InEditorPlaySettings.NewWindowHeight);
}
else
{
// Use the size for additional client windows.
InEditorPlaySettings.GetClientWindowSize(OutSize);
}
#Loc: <Workspace>/Engine/Source/Editor/UnrealEd/Private/PlayLevelNewProcess.cpp:258
Scope (from outer to inner):
file
function void UEditorEngine::LaunchNewProcess
Source code excerpt:
{
WindowSize.X = InParams.EditorPlaySettings->NewWindowWidth;
WindowSize.Y = InParams.EditorPlaySettings->NewWindowHeight;
}
else
{
InParams.EditorPlaySettings->GetClientWindowSize(WindowSize);
}
#Loc: <Workspace>/Engine/Source/Editor/UnrealEd/Private/Settings/LevelEditorPlaySettingsCustomization.cpp:348
Scope (from outer to inner):
file
function void FLevelEditorPlaySettingsCustomization::CustomizeDetails
Source code excerpt:
{
// new window resolution
TSharedRef<IPropertyHandle> WindowHeightHandle = LayoutBuilder.GetProperty( GET_MEMBER_NAME_CHECKED( ULevelEditorPlaySettings, NewWindowHeight ) );
TSharedRef<IPropertyHandle> WindowWidthHandle = LayoutBuilder.GetProperty( GET_MEMBER_NAME_CHECKED( ULevelEditorPlaySettings, NewWindowWidth ) );
TSharedRef<IPropertyHandle> WindowPositionHandle = LayoutBuilder.GetProperty( GET_MEMBER_NAME_CHECKED( ULevelEditorPlaySettings, NewWindowPosition ) );
TSharedRef<IPropertyHandle> CenterNewWindowHandle = LayoutBuilder.GetProperty( GET_MEMBER_NAME_CHECKED( ULevelEditorPlaySettings, CenterNewWindow ) );
TSharedRef<IPropertyHandle> EmulatedDeviceHandle = LayoutBuilder.GetProperty( GET_MEMBER_NAME_CHECKED( ULevelEditorPlaySettings, DeviceToEmulate ) );
WindowHeightHandle->MarkHiddenByCustomization();
#Loc: <Workspace>/Engine/Source/Editor/UnrealEd/Private/Settings/SettingsClasses.cpp:586
Scope (from outer to inner):
file
function void ULevelEditorPlaySettings::PostInitProperties
Source code excerpt:
NewWindowWidth = FMath::Max(0, NewWindowWidth);
NewWindowHeight = FMath::Max(0, NewWindowHeight);
NetworkEmulationSettings.OnPostInitProperties();
#if WITH_EDITOR
FCoreDelegates::OnSafeFrameChangedEvent.AddUObject(this, &ULevelEditorPlaySettings::UpdateCustomSafeZones);
#endif
#Loc: <Workspace>/Engine/Source/Editor/UnrealEd/Private/Settings/SettingsClasses.cpp:643
Scope (from outer to inner):
file
function void ULevelEditorPlaySettings::UpdateCustomSafeZones
Source code excerpt:
else
{
PIESafeZoneOverride = CalculateCustomUnsafeZones(CustomUnsafeZoneStarts, CustomUnsafeZoneDimensions, DeviceToEmulate, FVector2D(NewWindowWidth, NewWindowHeight));
}
if (FSlateApplication::IsInitialized())
{
if (bResetCustomSafeZone)
{
#Loc: <Workspace>/Engine/Source/Editor/UnrealEd/Private/Settings/SettingsClasses.cpp:657
Scope (from outer to inner):
file
function void ULevelEditorPlaySettings::UpdateCustomSafeZones
Source code excerpt:
SafeZoneRatio.Left /= (NewWindowWidth / 2.0f);
SafeZoneRatio.Right /= (NewWindowWidth / 2.0f);
SafeZoneRatio.Bottom /= (NewWindowHeight / 2.0f);
SafeZoneRatio.Top /= (NewWindowHeight / 2.0f);
FSlateApplication::Get().OnDebugSafeZoneChanged.Broadcast(SafeZoneRatio, true);
}
}
}
#endif