- Home /
individual letters appear in GUI from a word from array
hi everyone..
here's my problem, how can i make the letters appear in a GUI based on a word?
example : i got a word BOOK, and i want the LETTERS to be SPELT and appear as INDIVIDUALS on each GUI boxes..
so.. by the word BOOK <- from array
it turns to be [B] [O] [O] [K] <- to GUI.Box
any help is appreciated...
and many thanks to those who helped with this...
thanks..
Answer by syclamoth · May 17, 2012 at 06:27 AM
Try something like this:
for(int i = 0; i < wordString.Length; ++i)
{
GUILayout.Box(wordString[i]);
}
oo...
can you please explain on how the code works.. or.. can you post a sample code..??
either way..
thanks..
That was sample code. Or did you need JavaScript? You didn't specify, so I posted in C#, as is my preference.
so as in java script...
its like : for( var i : int = 0 ; i < wordString.Length; i++){ GUILayout.Box(wordString[i]); }
am i right??
k.. the script worked.. only that when i put in the word BALL or some other word to the wordString...
it came out BALL as one word... but i want it to be like this B_A_L_L ... spelling out the word...
can it be done??
Yes, that's right- did it all come out as a single box, or in seperate boxes? You can always intersperse them with
GUILayout.Space(10);
Your answer
Follow this Question
Related Questions
Appear after set number of seconds 2 Answers
How do I make GUI text disappear after a set amount of time? 1 Answer
Distance activated GUI 1 Answer
GUI box not appearing when button is clicked 1 Answer
when button pressed, textfield appears 3 Answers