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"

UMG, auto scaling

Hello, I have this widget:

alt text

alt text

and It contains Ability Item widget, which is ready to drag & drop, but when I drag every item out of the grid panel, the widget scale down. Like this:

alt text

alt text alt text

So... does UMG contain something like: keep size, Auto-scale off,...?

Thank you so much for answers.

Product Version: Not Selected
screenshot-1.png (30.0 kB)
screenshot-2.png (9.9 kB)
screenshot-3.png (44.0 kB)
screenshot-4.png (118.6 kB)
screenshot-5.png (125.7 kB)
more ▼

asked Apr 30 '19 at 01:08 PM in Everything Else

avatar image


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

1 answer: sort voted first

tl;dr - wrap it with a size box

The real answer depends on where this widget ends up at.

Every time a widget ends up in a a container, that container creates a slot for the child. A vertical box creates a different slot type than a canvas, some slots have additional properties - for example the grid has rows and columns, something a vertical box lacks.

  • If you drop a widget directly into the viewport - you can Set Desired Size in Viewport and the widget will respect that.

  • If you drop it onto a canvas - you can Set Size and / or even enable Size To Content - {also called Get / Set Autosize but the name was never updated}

However, most containers do not offer setting size explicitly but offer alignment options - Fill, Centre, Bottom and so on. This can be augmented by padding the slot from any side in order to reach the desired position / size.

If you do not want to manually Set Size every time or worry what container the widget ends up in, you can wrap the widget with a SizeBox and override its dimensions. In this case the SizeBox will try to maintain the widget size unless its direct parent is too small to fit it or has alignment rules that override the behaviour - like Fill.

Essentially, the root widget does not really decide what size it is, it's a combinations of their own children that try to expand and the root's own parent trying to contain and tolerate its desired size.

Do note - every time you add another wrapper to a widget, you increase its complexity and, eventually, it will eat into the performance - start worrying when you display hundreds of widgets unless you're running the game on a mobile potato.

I generally avoid Size Boxes as they complicate resizing and scaling of the user interface (one could argue that the overrides can be enabled / disabled on demand - which is true), but they can be useful when you need to drag it between various parents.

edit: also, consider looking into UserWidgets for reusable functionality - each of your ability should be a self-contained widget that you just add to the grid - there's no reason to set up dozens of borders and text boxes manually.

more ▼

answered Apr 30 '19 at 01:41 PM

avatar image

15.2k 77 25 62

(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