Changing UI Scale in Unreal Engine

UI scaling is a pretty standard feature of modern games. It lets players change how large the UI is shown, and is especially usseful for those playing on 4K monitors or TVs far away.

Luckily in Unreal it’s simple to do in C++, and works alongside any DPI scaling rules you may have.


#pragma once

#include "Kismet/BlueprintFunctionLibrary.h"
#include "EngineMinimal.h"
#include "MyGameplayStatics.generated.h"

class UMyGameplayStatics : public UBlueprintFunctionLibrary

	// Custom UI scale 1.0f == 100%, 2.0f == 200%, 0.5f == 50% etc.
	UFUNCTION( BlueprintCallable, Category = "User Interface" )
	static void SetUIScale( float CustomUIScale );


#include "MyGameplayStatics.h"
#include "Engine/UserInterfaceSettings.h"

void UMyGameplayStatics::SetUIScale( float CustomUIScale )
	UUserInterfaceSettings* UISettings = GetMutableDefault<UUserInterfaceSettings>( UUserInterfaceSettings::StaticClass() );

	if ( UISettings )
		UISettings->ApplicationScale = CustomUIScale;