Game Development Community

Toggle GUI Objects Visiblity

by Greg_ESAL · in Torque Game Engine · 10/04/2006 (1:34 pm) · 2 replies

I want to create a button that can toggle another gui object's visiblity. I thought about doing an if statement but I am more an artist than a scriptor so I got a bunch of syntax errors.

Is there any easy way to do this, or something I should look at for refrence?

Thanks

#1
10/04/2006 (2:03 pm)
GuiObject.setVisible(false);

Or something along those lines.

Edit: actually, that works for individual components of a GUI; to make the whole GUI invisible, just pop the dialog with something like Canvas.popDialog(YourDialog);
#2
10/04/2006 (2:12 pm)
Make your toggle button's command be something like this:

command = "otherGuiObject.setVisible(!otherGuiObject.getVisible());";