Game Development Community

Gui buttons

by Gavin Beard · in Torque Game Builder · 03/27/2005 (6:31 am) · 6 replies

Hey ya, how easy is it to access gui objects outside of the gui scripts? i.e in my gam when i deselect a unit or they have no move points i wan the option the move button to get disabled?

cheers

#1
03/27/2005 (6:40 am)
Gavin, If you look at the way that optionsdlg.gui is formated in the common/ui folder, you will see that there is a corrisponing optionsdlg.cs file in example\common\client. It's a good example of how to add functionality to gui's outside of the gui itself.

That is, of course, what you mean
#2
03/27/2005 (8:54 am)
Maybe, lol i shall look, i just want it so when differnt types of units, not all the gui buttons are avail. but that may do it

*edit seems all i need is movebtn.setactive(0); to deactivate a button :)
#3
03/27/2005 (9:31 am)
Yeah, whatever name you give a GUI control in the GUI editor is the same name you use in the script to call functions for it. Very simple and nice.
#4
03/27/2005 (9:34 am)
Or to make it invisible...
movebtn.setVisible(false);
#5
03/27/2005 (9:42 am)
I got them all now with .dump();
thanks for your help all
#6
03/27/2005 (8:20 pm)
Just to add a bit of confirmation... It all uses the same basic script space, you can reference teh GUIs throw script just like anything else :)