MinWindowHeight
MinWindowHeight
#Overview
name: MinWindowHeight
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 4
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of MinWindowHeight is to define the minimum allowable height for various windows in the Unreal Engine 5 editor and runtime environments. This setting variable is used to ensure that windows maintain a minimum size for usability and visual consistency.
Based on the callsites provided, MinWindowHeight is utilized in two main Unreal Engine subsystems:
- The Editor subsystem, specifically in the New Level Dialog module.
- The Runtime Engine subsystem, particularly in the GameEngine component.
The value of this variable is set in different ways depending on the context:
- In the New Level Dialog module, it’s defined as a constexpr float with a value of 280.
- In the GameEngine, it’s retrieved from project settings using the GetProjectSettingInt function, with a default value of 480 if not specified in the project settings.
MinWindowHeight often interacts with other variables such as MinWindowWidth, MaxWindowHeight, and MaxWindowWidth to define the overall window size constraints.
Developers should be aware of the following when using this variable:
- The value may differ between editor and runtime contexts.
- It can be overridden in project settings for the runtime engine.
- It’s used in conjunction with other size-related variables to define window properties.
Best practices when using this variable include:
- Ensure the value is appropriate for the content being displayed to maintain usability.
- Consider different screen resolutions and aspect ratios when setting this value.
- Use it consistently across different parts of the application to maintain a uniform user experience.
- When customizing, balance between providing enough space for content and not forcing unnecessarily large windows on users with smaller displays.
#Setting Variables
#References In INI files
Location: <Workspace>/Engine/Config/BaseGame.ini:84, section: [/Script/EngineSettings.GeneralProjectSettings]
- INI Section:
/Script/EngineSettings.GeneralProjectSettings
- Raw value:
16
- Is Array:
False
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Editor/NewLevelDialog/Private/NewLevelDialogModule.cpp:39
Scope (from outer to inner):
file
namespace NewLevelDialogDefs
Source code excerpt:
constexpr float LargeWindowHeight = 566;
constexpr float LargeWindowWidth = 1008;
constexpr float MinWindowHeight = 280;
constexpr float MinWindowWidth = 320;
}
struct FNewLevelTemplateItem
{
FTemplateMapInfo TemplateMapInfo;
#Loc: <Workspace>/Engine/Source/Editor/NewLevelDialog/Private/NewLevelDialogModule.cpp:585
Scope (from outer to inner):
file
function bool FNewLevelDialogModule::CreateAndShowTemplateDialog
Source code excerpt:
.Title(Title)
.ClientSize(WindowClientSize)
.MinHeight(NewLevelDialogDefs::MinWindowHeight)
.MinWidth(NewLevelDialogDefs::MinWindowWidth)
.SizingRule( ESizingRule::UserSized )
.SupportsMinimize(false)
.SupportsMaximize(false);
TSharedRef<SNewLevelDialog> NewLevelDialog =
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/GameEngine.cpp:543
Scope: file
Source code excerpt:
const int32 MinWindowWidth = GetProjectSettingInt(TEXT("MinWindowWidth"), 640);
const int32 MinWindowHeight = GetProjectSettingInt(TEXT("MinWindowHeight"), 480);
// Allow optional winX/winY parameters to set initial window position
EAutoCenter AutoCenterType = EAutoCenter::PrimaryWorkArea;
int32 WinX=0;
int32 WinY=0;
if (FParse::Value(FCommandLine::Get(), TEXT("WinX="), WinX) && FParse::Value(FCommandLine::Get(), TEXT("WinY="), WinY))
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/GameEngine.cpp:610
Scope: file
Source code excerpt:
.ScreenPosition(FVector2D(WinX, WinY))
.MinWidth(MinWindowWidth)
.MinHeight(MinWindowHeight)
.MaxWidth(MaxWindowWidth)
.MaxHeight(MaxWindowHeight)
.FocusWhenFirstShown(true)
.SaneWindowPlacement(AutoCenterType == EAutoCenter::None)
.UseOSWindowBorder(!bUseBorderlessWindow)
.CreateTitleBar(!bUseBorderlessWindow)