Announcement

Collapse
No announcement yet.

UMG Scaling Problem - Need help for uniform widget scaling

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    UMG Scaling Problem - Need help for uniform widget scaling

    Hi, I have a user interface widget which i want to scale into a horizontal box

    It sits on a canvas, (no horizonal or vertical box constraints) but i want it to uniformly scale the entire UI when being added to another widgets horizontal / vertical box.

    Click image for larger version

Name:	Capture.JPG
Views:	1
Size:	77.6 KB
ID:	1140464
    This is the widget i want to dynamically add to another widget...

    Click image for larger version

Name:	Capture1.JPG
Views:	1
Size:	75.4 KB
ID:	1140465
    This is what happens when i use the fill option - it cuts the widget top and bottom off (on widgets made using only horizontal and vertical boxes it works perfectly, but with this "loose" widget made of images, i cant seem to find a way to keep it uniformly scaling, is there a panel type im missing here?

    @agamedevguy twitter
    Renn Farnell Website

    #2
    Widgets don't automatically scale, they can take additional space if their parent forces them to, but unless the parent widget has special logic for scaling children, it wont. Horizontal and Vertical boxes don't actually scale their children, they just give children like buttons additional space and the child fills it out, but it's not a scale operation.

    What you need to do is,

    1) Place the widget inside a Size Box, this will allow you to specify a desired size the widget wants to be, a canvas does not report a desired size in 4.5, this will allow you to specify the nominal scale 1 size the widget reports as.

    2) Next, place all of that inside a Scale Box, this widget has all the logic and rules for how to scale child widgets based on their reported desired size (hence why we used the size box to guarantee our desired size, that will be scaled up or down from.

    Comment


      #3
      Hi Nick, thanks for the reply, i gave it a go, just to check im understanding correctly is this how youre advising i lay the widgets out?

      Click image for larger version

Name:	Capture5.JPG
Views:	1
Size:	163.7 KB
ID:	1060617


      Click image for larger version

Name:	Capture6.JPG
Views:	1
Size:	178.7 KB
ID:	1060618

      Thanks again

      @agamedevguy twitter
      Renn Farnell Website

      Comment


        #4
        Yes, now set the set the width and height override properties on the size box. And set the scale boxes scale rule to Fit.

        Comment


          #5
          aha brilliant thanks Nick!

          @agamedevguy twitter
          Renn Farnell Website

          Comment

          Working...
          X