Make user widget auto-scale

Hi!

I’ve just trying to create an user widget with some help

Do you know if there is a way to make this user widget auto-scale?

I don’t know how to do it. For example, with the images I have to set their size manually:

It seems that I can’t resize the widget if I resize its parents vertical box.

Thanks!

The images stay the size you typed because an Image’s desired size is the brush Image Size, or a Width/Height override. It is not the size of the parent. A Vertical Box only gives leftover space to a child whose slot is Fill. Auto means “hug the child’s desired size”, so dragging the Vertical Box bigger does nothing to those images.

If you want the contents to grow and shrink with the parent:

  • On each image slot inside the Vertical Box, set the alignment to Fill, not Top or Center.
  • Do not set a Width Override or Height Override on the Image. A Size Box with a width or height override around it will lock the size you are fighting, so take that off too.
  • Fill alone still will not stretch an Image. The image keeps reporting the brush size. Wrap the Image in a Scale Box and set Stretch to Scale to Fit (or User Specified if you want a single scale factor). The Scale Box takes the slot’s size and scales the image into it.
  • If this user widget is itself sitting in a parent Vertical Box, that slot has to be Fill as well. Size to Content on the user widget does the opposite: it hugs the images and ignores the parent.

If you want the whole widget to track the screen:

  • Put a Scale Box at the root, or a Canvas Panel with the anchors set to all four corners.
  • Project DPI scaling already scales UMG from the DPI curve. If it looks right at 1080p and wrong at other resolutions, check Project Settings, Engine, User Interface, DPI Scaling, rather than hardcoding sizes.
  • The size you drag in the designer is only the preview canvas. At runtime the widget gets whatever its parent slot gives it. Add to Viewport with no canvas slot fills the screen, and the children stay at brush size in the corner unless the root is anchored or inside a Scale Box.