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"

How to set the size of a UI element in pixel?

How can I set the size of a UI element in pixel without it changing its size through changing the viewport size?

I want an UI Image to be 512 pixel in width but whatever I do it changes it size when I change the viewport size. I'm using a size box element and the width override of it, inside is is a overlay with the image element inside. I need to be able to change the width override in Blueprint.

Product Version: UE 4.16
Tags:
more ▼

asked Oct 19 '17 at 06:35 PM in Using UE4

avatar image

Davision
789 55 92 140

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

1 answer: sort voted first

I found a workaround:

This is what scales it based on viewport size, you could also make the curve flat instead but then you have fixed pixel sizes for every UI element which is rarely what you want:

alt text

Copying that curve in a BP you can do this:

alt text

Needs to be then updated when the viewport size changes, like window scaling or resolution change

Your UI element needs to be in that referenced size box and it needs to have Size To Content, Width Override and Height Override set to True

dpi.jpg (50.9 kB)
fixedpixel.jpg (92.2 kB)
more ▼

answered Oct 21 '17 at 07:32 PM

avatar image

Davision
789 55 92 140

(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