V-o-i-d
(V-o-i-d)
September 6, 2021, 5:38pm
1
I’m making a spelling game for manly stroke victims but can be used for others.
I’m trying to show where the user made a mistake and set the color to red for those letters.
The only solution I can think of is to procedurally create static text widgets. Use a branch for each letter and set the color for each. With a for each loop that breaks down the string. Place them into a horizontal box.
problem is that I don’t see a way to make this happen any help would be great thank you.
Blockout22
(Blockout22)
September 6, 2021, 7:02pm
2
create a new widget that contains only text and create a variable(string/text/name) inside that widget
bind the variable to the widgets Text
then in your for loop create that new widget and add it to your horizontal box
that should get you started in what you are trying to achieve
V-o-i-d
(V-o-i-d)
September 6, 2021, 7:12pm
4
How to do it procedurally? like create the widget automatically, I don’t do it myself.
Blockout22
(Blockout22)
September 6, 2021, 7:13pm
5
you expose the variable on spawn and when you create a new widget a new input pin will appear
V-o-i-d
(V-o-i-d)
September 6, 2021, 7:14pm
6
and I dont have to do it my self?
Blockout22
(Blockout22)
September 6, 2021, 7:16pm
7
that depends entirely how you setup your widget and what information you want to give that widget through your forloop
I suggest you run a simple test to first understand how to add widgets during runtime to your horizontal box
V-o-i-d
(V-o-i-d)
September 6, 2021, 7:24pm
8
Thing is I don’t understand how? I dont get what your trying to say
Blockout22
(Blockout22)
September 6, 2021, 7:34pm
9
Let’s start with creating a new widget
Remove the canvas and add text
Create a new string variable
In that variable, enable ‘Instance Editable’ and ‘Expose on spawn’
Close that widget and open your main widget
in your for loop create and add your new widget and input data inside the extra pins that show up
that will create your widgets dynamically to get you started…
to get the syntax you are after, you might be able to use “Rick Text Block” instead of just Text
3 Likes
V-o-i-d
(V-o-i-d)
September 6, 2021, 7:43pm
10
Im going to try it and let you know how it goes thank you for your example!
1 Like
Everynone
(Everynone)
September 7, 2021, 11:47am
11
This is the way to go, to get you a little bit closer:
Turn the text into an array and push letter widgets into a horizontal box.
1 Like