Reverse order of scrollbox widget?

This is a piece of functionality that has been missing from UMG. I’m going to shamelessly quote myself from the forums here:

Unfortunately, you cannot directly manipulate the child order in a widget container. You have 2 options here:

  1. Create a temporary array and order insert/add/remove widgets there. Use that array to add widget children to a container. (you will need to clear the container first, and either redraw all widgets or just the ones whose order have been affected - some fiddling with the indexes will be necessary here)
  2. Flip the container upside down (render transform → angle 180), do the same for every child that you add

Use #1 if you need to add (insert) a widget at a specific index, use #2 if you need a simple inverted list.

Hope it helps.

Hey all, I am working on a project and have got myself stumped. I have made a UI Widget that notifies the player when they’ve obtained an item, and they way I’ve handled that is by adding children to a scrollbox widget. However, currently the notifications start at the top of the scrollbox and any more that are added are placed underneath it. I would like to figure out how it is possible to have the first child start at the bottom of the screen, then additional children being added above it. I may have approached it all wrong so I am fine with starting it from scratch, I just cant seem to figure out how to achieve this.

Here’s a video example of what I am trying to achieve, pay attention to the bottom right corner of the screen:

[Video Example][1]

Here’s a picture and a video of my current setup:


[Video of setup in action][3]

Thanks! Got it to work using a combination of your two suggestions.

Thank you :slight_smile:

The second variant sounds like a great hack :wink: I’ll try it in my own project, thanks!

This helped me a lot. Thanks! i just want to mention that using the second method does put the scroll bar on the opposite side, but you can hide it if its not wanted.

I know this question is older, but I just had the same problem (trying to populate a scrollbox with child widgets by using a ForEachLoop). This brought me to the idea: what if I could just reverse the array. And you know what, seems like there is a ReverseForEachLoop Macro already built in. Works like a charm. What it does is simply checking the array from last index to first index (0) instead of first index to last index. In short: it creates your last array index first.
307490-

2 Likes

You saved my life