In-Game Player Input
by Nick Voloro · in General Discussion · 05/07/2008 (3:33 pm) · 3 replies
Hello, I have done a lot of research on this matter and I can't really find anything on it. When the player arrives at the bank I would like him to type in how much money he wants to deposit. But my problem is I can't find out how to make a gui where the player can input an integer that will be stored as a variable. Any help would be greatly appreciated. Thanks.
#2
05/08/2008 (1:55 pm)
Is there anyway to get it by text input? Is there any gui out there that is capable of that?
#3
You can assign the field altCommand in your GuiTextEditCtrl to a function you want executed when "enter" is pressed. There you can use getValue() to get what they have entered.
05/08/2008 (2:13 pm)
You probably want to use a GuiTextEditCtrl for inputing text. Torquescript does not have any types so you don't have to worry about "saving their input as an integer".You can assign the field altCommand in your GuiTextEditCtrl to a function you want executed when "enter" is pressed. There you can use getValue() to get what they have entered.
Torque Owner Jason MacWilliams
Have you considered using a scrollbar / slider to get an integer input? It might be easier to get the value from that than from text.