[UMG] Fixed size widgets independent of resolution

Hi,

I am trying to find out how to create widgets of fixed size (in pixels) that don’t scale when you change the resolution.

As an example, in my game I want to have a top bar width=100%, height=30px which has a background image of 1920x30 which is centered at horizontally.

Another example, a button with a background image 160x40 that takes 160x40 in every resolution.

I have played around with UMG and when I change the resolution of the game window it scales all the widgets including the text.

Is it possible to create widgets of fixed size at all?

Best regards

You can turn off the DPI scaling by just adjusting the curve to be a scale of 1 on all resolutions. The only other option for targeting specific widgets is to apply an inverse scale of the current DPI scale to the widget, using the Scale box you could wrap it inside of, set it to manual and then apply the inverse scale.

Thank you very much!!

Changing the DPI scaling to 1 completely solved my problem.

Best regards

I need to apply a fixed pixel size to only a specific widget and that through Blueprint. How would I be able to get the DPI scale in Blueprint to be able to apply the inverse scale of the current DPI to the widget?

For those who have this problem: I just resolved using the node “GetViewportScale” and then dividing the widget size I want to obtain by this value.

1 Like

thank you that solved my problem too

Then what? Plugging it into “Set desired size in viewport” doesn’t work and Set render scale ignores alignment.