Game Development Community

GUI variable fields

by Drew -Gaiiden- Sikora · in Torque Game Builder · 07/13/2005 (10:44 pm) · 2 replies

I have a text edit control in my GUI that holds the player's name. In the "variable" field I have it set to $gameData.playerOne.name:
$gameData = new ScriptObject(gameData);
    $gameData.playerOne = new ScriptObject();
        $gameData.playerOne.name = "player 1";
That's just a condensed version of my $gameData structure obviously. I understood that the "variable" field was used with the GUI control so that when the control was updated it would update whatever variable was specified in the "variable" field. However if I change the text in the edit box and dump() the playerOne data, .name still equals "player 1". What am I missing?

#1
07/14/2005 (12:19 am)
The GUI object will display the value of the variable, but it won't automatically put the contents of the text box back into the variable unless you script it to do it. You'll need at some point to have a line of script that gets the value of the text box and puts it into the variable.
#2
07/14/2005 (12:46 pm)
Gotcha, thanks