r.MinYResolutionForUI

r.MinYResolutionForUI

#Overview

name: r.MinYResolutionForUI

This variable is created as a Console Variable (cvar).

It is referenced in 3 C++ source files.

#Summary

#Usage in the C++ source code

The purpose of r.MinYResolutionForUI is to define the smallest vertical resolution (Y-axis) that the game’s user interface (UI) should support. This setting is primarily used for UI scaling and layout purposes in the rendering system.

This setting variable is relied upon by the Engine module, specifically within the KismetSystemLibrary. It’s part of the core engine functionality related to UI rendering and scaling.

The value of this variable is set through a console variable (CVar) system. It’s initialized with a default value of 720 pixels, but can be changed at runtime through console commands or configuration files.

The associated variable CVarMinYResolutionForUI directly interacts with r.MinYResolutionForUI. They share the same value and purpose.

Developers must be aware that this variable affects the minimum vertical resolution for UI elements. It’s important to consider this when designing and implementing UI layouts to ensure they scale properly on different screen resolutions.

Best practices when using this variable include:

  1. Consider the target platforms and their typical screen resolutions when adjusting this value.
  2. Test UI layouts at various resolutions, including the minimum set by this variable.
  3. Use the GetMinYResolutionForUI() function from UKismetSystemLibrary to retrieve the current value, rather than accessing the CVar directly.
  4. Be cautious when lowering this value, as it may impact UI readability on smaller screens.

Regarding the associated variable CVarMinYResolutionForUI:

The purpose of CVarMinYResolutionForUI is to provide a programmatic interface to the r.MinYResolutionForUI console variable. It allows C++ code to interact with the minimum UI resolution setting.

This variable is used within the Engine module, specifically in the KismetSystemLibrary.

The value of CVarMinYResolutionForUI is set when the r.MinYResolutionForUI console variable is modified.

CVarMinYResolutionForUI directly interacts with r.MinYResolutionForUI, as they represent the same setting.

Developers should be aware that this variable is thread-safe for the render thread (ECVF_RenderThreadSafe), which means it can be safely accessed from both game and render threads.

Best practices for using CVarMinYResolutionForUI include:

  1. Use the GetValueOnGameThread() method to retrieve the current value safely from the game thread.
  2. Avoid modifying this variable directly; instead, change the r.MinYResolutionForUI console variable.
  3. Consider caching the value if it’s frequently accessed, as reading console variables can have a performance cost.

#References in C++ code

#Callsites

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

#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/KismetSystemLibrary.cpp:2714

Scope: file

Source code excerpt:


static TAutoConsoleVariable<int32> CVarMinYResolutionForUI(
	TEXT("r.MinYResolutionForUI"),
	720,
	TEXT("Defines the smallest Y resolution we want to support in the UI (default is 720)"),
	ECVF_RenderThreadSafe
	);

static TAutoConsoleVariable<int32> CVarMinYResolutionFor3DView(

#Associated Variable and Callsites

This variable is associated with another variable named CVarMinYResolutionForUI. They share the same value. See the following C++ source code.

#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/KismetSystemLibrary.cpp:2713

Scope: file

Source code excerpt:

}

static TAutoConsoleVariable<int32> CVarMinYResolutionForUI(
	TEXT("r.MinYResolutionForUI"),
	720,
	TEXT("Defines the smallest Y resolution we want to support in the UI (default is 720)"),
	ECVF_RenderThreadSafe
	);

#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/KismetSystemLibrary.cpp:2729

Scope (from outer to inner):

file
function     int32 UKismetSystemLibrary::GetMinYResolutionForUI

Source code excerpt:

int32 UKismetSystemLibrary::GetMinYResolutionForUI()
{
	int32 Value = FMath::Clamp(CVarMinYResolutionForUI.GetValueOnGameThread(), 200, 8 * 1024);

	return Value;
}

int32 UKismetSystemLibrary::GetMinYResolutionFor3DView()
{