How do I make the Anchor offsets in UMG be a percent of canvas?

How do I make the Anchor offsets in UMG be a percent of canvas?

The new UMG UI stuff is very promising, but I can’t get the UI elements to properly scale with the view screen.
I can use the anchor layouts to squash UI elements based on view screen size, but they are at fixed offsets.
I need them to scale as a percentage of the view screen so re-sizes work properly.

Is there a way to do this yet?

Hi Erdrik, it’s not easy to configure at the moment, but what you need to do to achieve this effect is to manually edit the anchors. They’re Min X, Min Y, Max X, Max Y.

If you wanted to have something stretch via a percentage you’d adjust those values. The customization that you used to make it stretched sets the maxes to 1 and the min to 0. Those are the normalized anchor points. if you wanted something to always be 10% from the top/left and 10% from the right, bottom. Those numbers would be min (0.1), max (0.9). Then you’d zero out the offsets, which when stretching represents your margin from the calculated normalized anchor position.

It’s complicated, it’s one of those things that can be improved greatly with a better customization and more visual aides in the designer.

Cheers,
Nick

1 Like