Download

Screen Space Widget Component Not Scaling with Window Size (Swap Custom Scaling Rule Class)

Hello,

In my project I’ve added a widget component to the character. I’ve set the widget to screen space. However, the widget does not seem to scale with the screen when the screen is resized. Below are images of the game running in two different window sizes. The green box is the character and the grid is the widget component.

If anyone knows how I can have a screen space widget component scale with the game window, your advice would be appreciated.

Thank you.

I guess what I need here is some kind of DPI scale rule that would just scale this widget uniformly. I’m not sure what exactly the process for having different scale rules for different widgets would be. Is there a way I could swap out the custom scaling rule class in blueprint or C++?

Are you resizing the viewport run-time or just testing different resolutions?

The DPI scaling is here btw:

Yes, in a new PIE window.

Here’s my hierarchy in case it helps. *Moving Panel *is the only canvas panel.

Screen-Shot-20190504-at-4.14.12-PM.png

Hm, you could try ticking *Draw Desired Size *in the Widget Component. And make sure you release the mouse button after resizing, this is not something that would be updated in real time.

Just to clarify, will the user be allowed to fiddle with the viewport size run-time?

Ah, that’s a good point. I guess the user won’t be able to change the window size without entering the settings page and waiting for a refresh, etc. That does make my job easier. Thanks. In that case I can just get the viewport size and scale the widget to a preset size when they choose their resolution. (:

I thought it might be easier to make a non-component widget but telling widgets to ignore the DPI scale curve and just scale uniformly with the screen seems beyond my knowledge.

Just noticed your example has this optical illusion - cursed image :smiley:

download.png

So hold on, both the green box and its cursed image background are wrapped in widget components or…? I mean, for as long as both are one thing or the other, it should just work. At least be consistently bad / fine.

Are you making the entire game in UMG or is this a minigame?

The green box is the player’s 3D character. The cursed image :rolleyes: is the widget whose hierarchy I posted earlier. I was only using widget component as a way to help scale it. If I can scale the widget without using a widget component, that would be ideal. Either way, currently it scales along the DPI curve but for this particular widget, I need it to ignore the curve and just scale uniformly.

Man, that thing’s hard to look at. My eyes!