Announcement

Collapse
No announcement yet.

[UMG] Fixed size widgets independent of resolution

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

    [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

    Eduard

    #2
    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.

    Comment


      #3
      Thank you very much!!

      Changing the DPI scaling to 1 completely solved my problem.

      Best regards

      Eduard

      Comment


        #4
        Originally posted by Nick Darnell View Post
        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.
        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?

        Comment


          #5
          Originally posted by Davision View Post

          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.

          Comment

          Working...
          X