GUI commands/variables help? setFloatVariable( ), multiple commands?
by NewGuy1month · in Game Design and Creative Issues · 09/02/2012 (2:24 pm) · 0 replies
Hey, just got started with Torque3D less than a month ago, but I've got four questions about Gui. First, I can't seem to get GuiControl::setFloatVariable() to work. This is the problem code, minus the other stuff like button text:
new GuiButtonCtrl(BlkPwdr20) {
Variable = "$BlkPwdr";
Command = "GuiControl::setFloatVariable(GuiControl::getFloatVariable()+20);";
}
but it says "<input> (0): Unable to find function GuiButtonCtrl::setFloatVariable". I want it to add 20 onto the value of $BlkPwdr. I tried changing GuiButtonCtrl to the name of the control, but that didn't work either. What am I doing wrong?
Second, I looked in a couple of other Gui files and the variable doesn't have the $ before it. Is it necessary?
Third, is it possible to have the button trigger multiple commands/have it act on multiple variables at once? Say I wanted it to increment $BlkPwdr and then to change the value of a text control or its variable. Can I do that, and how?
Last, if I link a text control with a variable, does it automatically update by itself when its variable changes, or do I have to do it manually?
new GuiButtonCtrl(BlkPwdr20) {
Variable = "$BlkPwdr";
Command = "GuiControl::setFloatVariable(GuiControl::getFloatVariable()+20);";
}
but it says "<input> (0): Unable to find function GuiButtonCtrl::setFloatVariable". I want it to add 20 onto the value of $BlkPwdr. I tried changing GuiButtonCtrl to the name of the control, but that didn't work either. What am I doing wrong?
Second, I looked in a couple of other Gui files and the variable doesn't have the $ before it. Is it necessary?
Third, is it possible to have the button trigger multiple commands/have it act on multiple variables at once? Say I wanted it to increment $BlkPwdr and then to change the value of a text control or its variable. Can I do that, and how?
Last, if I link a text control with a variable, does it automatically update by itself when its variable changes, or do I have to do it manually?