Hello,
I am adding buttons dynamically to a scrollbox “Roster”. The button gets added, with a text entry on it properly displaying the character’s name.
It is my desire that when the button is clicked, it will open up a character sheet for that character.
My thinking was that i would call the stats of the character from an array, and the specific character’s index in that array will match the button’s position in the scrollbox (for example, button at index 0 matches character at index 0 in the Roster array.)
However, I don’t quite know how I go about finding out what position a dynamic button has in the scrollbox grid. When the button is clicked, what is the best approach to identifying it’s position in a grid? Note, the button and its code is in a blueprint separate from that of the scrollbox (I followed Rama’s excellent UMG, Create Scrollable List tutorial) and it doesn’t exist until created and added to the scrollbox during runtime.
Is there a function for a widget that allows it to identify its own position within a parent’s collection?
I hope this was enough information. Thank you for any assistance that can be provided.