- Home /
Question by
setn2007 · Jan 27, 2014 at 08:28 AM ·
guigui-buttongui-text
GUI.Toolbar ?
I'm trying to create a hangman type game I would like to have blanks then when you hit the correct button it sets the text from that button onto the correct blank what i got now allows me to choose the 2 corresponding buttons then makes something appear in the debug log is there an eaiser way or harder but neater way to write this please help me..
here is my code
pragma strict
ar words : int = 0; var guesses1 : int = 0; var guesses2 : int = 0; var verse : String [] = ["", "", "", ""]; var blanks1 : String [] = ["","", "", ""]; var blanks2 : String [] = ["","", "", ""]; var cor1 = true;
function Update()
{
if ( guesses2 == 0 && words == 1)
{
cor1 = false;
}
if (cor1 == false)
{
Debug.Log ("hi");
}
}
function OnGUI ()
{
words = GUI.Toolbar (Rect (Screen.width*0.5-430, Screen.height-175, 850, 150), words, verse );
guesses1 = GUI.Toolbar (Rect (Screen.width*0.5-430, Screen.height-750, 850, 150), guesses1, blanks1);
guesses2 = GUI.Toolbar (Rect (Screen.width*0.5-430, Screen.height-750, 850, 150), guesses2, blanks2);
}
please help me Thanks, Chris
Comment
Your answer
![](https://koobas.hobune.stream/wayback/20220613131615im_/https://answers.unity.com/themes/thub/images/avi.jpg)