Game Development Community

Turning 'Off' A Toggle Button Through Code?

by David Taylor · in Torque Game Builder · 04/16/2007 (4:59 am) · 3 replies

I have some toggle buttons which invariably get clicked, and 'activated', for lack of a better word. I have another button that will reset all of these buttons to an 'inactive' state. How do I do that through script? The toggle buttons all belong to the same class and are individually named...but I don't know how I change them to inactive.

I am imagining it would be fairly simple. Somwthing like:

%toggleButtonName.active = false;

Does anyone know hat command or variable I should be toggling (no pun intended) tog et this to work?

#1
04/16/2007 (5:59 am)
Well like any other control e.g. check box you can use setValue()

%toggleButtonName.setValue( false );
#2
04/16/2007 (6:09 am)
Fantastic, thanks! That did the trick. :)
#3
04/16/2007 (6:15 am)
No problemo ;p