scale UMG at runtime

Hi,

is it possible to scale UMG widgets at runtime?

thanks in advance,

any suggestion how?

Yes you can scale them at runtime

Are you planning to scale them to fit display resolution, or scale for animation?

This setup scales widgets according to dpi curve.

229740-wop.png

1 Like

Here by using umg timeline animation you can change scale color transform etc during runtime

Users need to have the ability to scale the UI based on how far they sit from there screen.

So basically you just get desired widget from you umg hud reference and can set scale using following nodes

229742-asd.png

the problem with using SetRenderScale is that my widget goes beyond my screen borders, actually what I want is that text en buttons becomes bigger and stays in the viewport. im calling the SetRenderScale in the widget itself (what is shop exactly in your widget?)

Shop is button in my widget. Im not sure but you can try anchoring.

Seems like you will have to move your widget whenever scaling so that it wont go beyond :confused:

Hi,

i tried different anchors but still gives the same issue

It would be great to have a SetViewportScale node.
Is there a way to achieve this?

1 Like

May be you can clipping in widget. In widget properties panel. It should set bound instead of inherit.

I know this is an old topic, but I couldn’t find an answer for this on the forums. As a note, for full UI scale one can use the following snippet (found one on the internet):

void UGameFunctionLibrary::UTIL_SetScaleUI(float Scale)
{
	UUserInterfaceSettings* UISettings = GetMutableDefault<UUserInterfaceSettings>(UUserInterfaceSettings::StaticClass());

	if (UISettings)
	{
		UISettings->ApplicationScale = Scale;
	}
}
3 Likes