Game Development Community

Dynamic GUI Parents?

by Chris "DiGi" Timberlake · in Torque Game Engine · 11/20/2005 (12:45 pm) · 3 replies

Is there a command to give dynamically created GUI Controls, a parent?

Example:

$foo = new GuiControl(PIE);
$foo.extent = "0 0 0";

$foo.SetParent(MainMenuGui);

#1
11/20/2005 (1:24 pm)
%parent.add(%child);
#2
11/20/2005 (5:00 pm)
Would that work with the GUIControl's Name? Such as PIE.add(MainMenuGui); ?
#3
11/20/2005 (6:09 pm)
Yep. works that way too.
MainMenuGui.add(Pie);

will add Pie to the MainMenuGui, thus Parenting Pie, to MainMenuGui.