Cant find a inputTextBox tutorial.
by Zergcow · in Torque Game Engine · 03/05/2008 (10:51 am) · 3 replies
I am basically trying to set up a GUI that has a text input field where i can enter a name. That name gets saved to a variable like %objname then it pops up in the text field bellow the apply number. when i am done i can click the done button and place new object with its new name (using the starter RTS kit) So i guess there are a few questions.
First: how do i create a textinput that will save a variable when i hit apply then show that variable in a text box under the apply button.
Second: (and this is more of an RTS kit question) how do i save that variable to be called by the building place command. (these buildings are hooked into databases as well and when i give it a name it will load all the database info based on its name)
Last: Where can i find tutorials on this kind of stuff? Or at least something that can lead me to the anwsers? I have already made all the GUI parts and I have all the building placement and hooking to databases working but i want to have the ability to name them befor placing them.
First: how do i create a textinput that will save a variable when i hit apply then show that variable in a text box under the apply button.
Second: (and this is more of an RTS kit question) how do i save that variable to be called by the building place command. (these buildings are hooked into databases as well and when i give it a name it will load all the database info based on its name)
Last: Where can i find tutorials on this kind of stuff? Or at least something that can lead me to the anwsers? I have already made all the GUI parts and I have all the building placement and hooking to databases working but i want to have the ability to name them befor placing them.
About the author
#2
so the text box would say "10" ... i dunno, i did it a little more complex with text inputs and accept buttons and global variables and everything else ... took all day just to setup how they all link
but adding stuff using that guiobj.id=something makes it easy to assign local and global variables to stuff. or make new variable or do whatever. i just needed to understand how to create a set of dynamic fields and then how to update and change them. Now i know that if %b=myobj and i did %b.name=blue then it would name the obj "blue" and if i did %b.newfield=red it would create a new value attached to my obj and give it the value "red". so now i am on a roll with this UI stuff.
03/05/2008 (7:17 pm)
Yea that helped alot actually. my big problem was understanding how to manipulate GUI stuff. Here is how i ended up doing it really ...%localvar=10 new GuiCtrl(theBox); new GuiTextCtrl(aText); theBox.add(aText); aText.text = (%localvar);
so the text box would say "10" ... i dunno, i did it a little more complex with text inputs and accept buttons and global variables and everything else ... took all day just to setup how they all link
but adding stuff using that guiobj.id=something makes it easy to assign local and global variables to stuff. or make new variable or do whatever. i just needed to understand how to create a set of dynamic fields and then how to update and change them. Now i know that if %b=myobj and i did %b.name=blue then it would name the obj "blue" and if i did %b.newfield=red it would create a new value attached to my obj and give it the value "red". so now i am on a roll with this UI stuff.
#3
03/05/2008 (8:16 pm)
Hey, if i made a "new GuiButtonCtrl (aButton)" how do i rename that? do i do "aButton.setName=bButton"?? does that work?
Torque 3D Owner Ted Southard