Write string vertically or dynamically instantiate UI widget using Button Click event in UI widget?

I am trying to create a UI widget in unreal 4.7…
What i want here is that when the player clicks on any of the button on right the text button on left gets updated as well.
I tried to find a way so that i can dynamically create them on click of button but couldn’t get something workable… I could use a single string also to store the string for representation if I could be able to represent it vertically. But that also seems not available. Please help me out!!

For Example: String: “FWD-10 BKD-10 LFT-90 RGT-90”

Should be represented as:





Note: I want it to happen right when the user clicks on the button.

I did it something like this. One of my friend suggested this way. What do you think?

CMIIW, but until I write this, the default engine can’t create new class or object from blueprint, only pawning actor. So, you should use structure instead of using object as data structure. The only way to create new class or object is create it from C++ class. so you can create static function with object as it’s parameter then call it from blueprint.

Same goes for your current problem. The solution I offer to you is, instead of using textbox in widget, you can use draw text in HUD. Look at the content example from learning and read this documentation:

If you still insist with your way, then this is the way that I can suggest for you:

  1. Create 10 (or more, whatever you want) text in widget design
  2. Create an array with text as its variable types
  3. Add all the text in array (do it in order)
  4. Add event on mouse click from the button in widget graph
  5. Split the string using Parse Into Array function, not Spit function look at below link for documentation
  6. Make logic if the array from splitted string has length more than the available text, then it do nothing
  7. Otherwise, write to text using array of text created earlier, with the same index as array of string from splitted string

I hope it’ll help you out

That’s great! That’s something new for me too. Thanks for the share…