Hi,
I’d like to be able to store names and numbers which the user can input and then be able to display them in a vertical box within a widget. At the moment I can get the user to type in the names and numbers within a widget which then gets passed to another widget’s vertical box using an Add Child To Vertical Box as shown below.
But I don’t know how to store every single user input. I am only able to store the last user input in a string variable. I’d like to be able to store every single input, in the order of each entry, so when the application/game starts again it can get loaded and displayed in a widget’s verticle box.
Any help would be really appreciated.
Create an array of string variables. Every time the user types a message and hits enter, add it to the array. You can then read the array and add widgets to the vertical box in a loop.
Thank you Everynone,
I think I managed to add each input into a string array. But I am not sure how to add that to a vertical box. I was wondering if I could keep this simple by using a widget switcher, all within the same widget, instead of two separate widgets as I first mentioned above.
Would it be possible to do it all within the same widget using a widget switcher? Let me show you what I mean below.
The user types something (in the first image) and on text committed it switches widgets and the input gets added to the array. And then I would like the accumulated input within the array to get added to the vertical box in the widget I switched to (in the second image). But I’m not really sure how to do that.
Thank you, Newest.
I thought data tables are read-only, as in the user cannot edit them in run time and only get data from them once already created. I would like the user to, for example, be able to add names to a list and to be able to do so an unlimited number of times. Would the user be able to add extra rows in-game using a data table?
With arrays, I noticed that they were dynamic where the user is able to add extra names to a string array in-game.
@yuyake79 What you’re trying to accomplish is perfectly doable. What kind of widget do you want to add to the vertical box? Just a text block?
While you cannot dynamically spawn text blocks, there is a simple solution. Create a custom widget that holds just a single text block with an exposed variable (I called it VerticalBoxLine here). Then you can populate the vertical box by spawning lines of text like so:
Yes, it was just a text block that I wanted to add to the vertical box.
I am attempting this solution you have here. How did you add that extra string pin onto your create widget? I can’t seem to find the option to add extra pins.