|
When I press the above buttons on the GUI (the main menu in the game), letters appear in a textfield at the bottom of the menu. There's just one problem- I would like to type letters into the textfield and, depending on the numbers I entered, the buttons above will be pressed. Each time I try, I cannot configure it. When I try, I cannot type in the text field, as I am constantly assigning a value to the items in the field. Clicking buttons will assign letters- that part is easy. I want to have the choice to press the buttons or paste in a letter combination. I will also have many more parameters which means that I will need many more "letter#" variables, or else I would not go through all of this trouble. Thank you very much for your knowledge and time. //drag this javascript onto the main camera, which should be the only thing in the scene var classCode = ""; public static var playerName = "N. A. B."; var primaryWeapon = "Pistol"; var letter1 = ""; var letter2 = ""; var letter1hold = ""; var letter2hold = ""; var toolbarInt = 0; var toolbarStrings : String[] = ["Team 1","Team 2"]; function OnGUI () { //instructions at top GUI.Label(Rect(100,25,150,30),"Create Your Soldier"); //display health at bottom // if(letter1=="A") toolbarInt = 0; // if(letter1=="B") toolbarInt = 1; // if(letter2=="L") primaryWeapon = "Launcher"; // if(letter2=="P") primaryWeapon = "Pistol"; } Typing in "AL" into the textField should put you on team A and give you a launcher.
(comments are locked)
|
