UMG Verticle box Add child at index
I want to add children to a vertical box at a specific index at runtime. Currently all I can do is "Add child", and it just adds the element at the top of the list.
I looked through the code and found that there is a "ShiftChild" function in c++ that is used in the editor for rearranging widgets. But it's apparently blocked by a #ifdef for use with the editor only. This is the case in 4.8 as well.
How can I do this then? Ideally I'd like to do it in BP, but if there's a way to do it in code I can easily make a BP node or something.
asked May 17 '15 at 08:56 PM in Blueprint Scripting
The only reason that function exists is for the editor is because we completely rebuild the slate widget when the structure changes, so it's safe to restructure it. Not every kind of slate panel understands inserting at runtime.
Personally, I'd probably consider building a different kind of panel. Guessing you're making list of scores or something you're constantly trying to re-sort? I'd probably build some kind of SPriorityBox in slate, where there's some arbitrary priority value the panel sorts by before drawing.
Otherwise, I would suggest making engine modifications to add the function to vertical box. The fields you need to are protected, so just making a C++ function to do it, isn't really an option.
answered May 19 '15 at 03:20 PM
Nick Darnell ♦♦ STAFF
2019 still no solution for this.
If it worth something, I solved this problem by firstly ordering my array, not ordering the vbchilds, once my array is ordered, insert it as you wish.
answered Mar 30 '19 at 02:46 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here