x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

UE4 How does UMG Scaling Work?

Hi all,

I am doing some of my HUD stuff with UMG widgets, but some of it inside the HUD blueprint using Draw Texture Simple functions and stuff. What I want is that when the viewport size changes, the things drawn by my HUD blueprint and the things drawn by my widget blueprint both scale in the same way, so they line up. I am aware that by default UMG uses the length of the smallest side and uses that to scale how big the things are that it draws, but how does it work with scaling the position of the things it draws?

I assumed here that what it does is gets the size of the shortest side of the viewport and divides it by 180 to create a multiplier. Then it could apply that multiplier to both the scale of the objects and the position of them. So, I created a HUD blueprint that worked the same way. But when I scale the viewport they don't line up, so my assumption must be incorrect. How does UMG scaling work and how can I simulate that in my HUD blueprint?

Thanks in advance!

Product Version: Not Selected
Tags:
more ▼

asked Feb 10 '18 at 04:22 PM in Blueprint Scripting

avatar image

MarsMiner
47 5 10 19

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

1 answer: sort voted first

Looks like I have answered my own question. I am posting a reply for anyone else wondering the same thing.

UMG widgets scale position based on position relative to the anchor. So, if you anchor something to the centre of the screen it will scale differently to if it was anchored to the top left of the screen. My problem was that my widgets were anchored to the centre, but the way my HUD code worked was effectively anchoring it to the top left. Therefore, they didn't line up. Hope this helps someone!

more ▼

answered Feb 10 '18 at 05:15 PM

avatar image

MarsMiner
47 5 10 19

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question