How can I dynamic add sub gui window?
by Ken · in Torque Game Builder · 07/05/2005 (12:34 am) · 2 replies
I have a login gui,it define in login.gui:
//--- OBJECT WRITE BEGIN ---
new GuiChunkedBitmapCtrl(login) {
profile = "GuiDefaultProfile";
horizSizing = "right";
vertSizing = "bottom";
position = "0 0";
extent = "800 600";
minExtent = "8 2";
visible = "1";
bitmap = "./guiimage/login/f_000";
useVariable = "0";
tile = "0";
new GuiBitmapButtonCtrl(server1gui) {
profile = "GuiDefaultProfile";
horizSizing = "right";
vertSizing = "bottom";
position = "189 82";
extent = "191 45";
minExtent = "8 2";
visible = "1";
command = "connect();";
text = "Button";
groupNum = "-1";
buttonType = "PushButton";
bitmap = "./guiimage/login/f_003";
};
new GuiBitmapButtonCtrl(Server2gui) {
profile = "GuiDefaultProfile";
horizSizing = "right";
vertSizing = "bottom";
position = "188 137";
extent = "191 45";
minExtent = "8 2";
visible = "1";
text = "Button";
groupNum = "-1";
buttonType = "PushButton";
bitmap = "./guiimage/login/f_004";
};
};
//--- OBJECT WRITE END ---
and I want to add a sub gui for login at application run time,but not in login.gui .
how can I do?
thanks
//--- OBJECT WRITE BEGIN ---
new GuiChunkedBitmapCtrl(login) {
profile = "GuiDefaultProfile";
horizSizing = "right";
vertSizing = "bottom";
position = "0 0";
extent = "800 600";
minExtent = "8 2";
visible = "1";
bitmap = "./guiimage/login/f_000";
useVariable = "0";
tile = "0";
new GuiBitmapButtonCtrl(server1gui) {
profile = "GuiDefaultProfile";
horizSizing = "right";
vertSizing = "bottom";
position = "189 82";
extent = "191 45";
minExtent = "8 2";
visible = "1";
command = "connect();";
text = "Button";
groupNum = "-1";
buttonType = "PushButton";
bitmap = "./guiimage/login/f_003";
};
new GuiBitmapButtonCtrl(Server2gui) {
profile = "GuiDefaultProfile";
horizSizing = "right";
vertSizing = "bottom";
position = "188 137";
extent = "191 45";
minExtent = "8 2";
visible = "1";
text = "Button";
groupNum = "-1";
buttonType = "PushButton";
bitmap = "./guiimage/login/f_004";
};
};
//--- OBJECT WRITE END ---
and I want to add a sub gui for login at application run time,but not in login.gui .
how can I do?
thanks
#2
I have find a method:
for(%i = 0; %i<$g_ServerNum;%i++)
{
new GuiBitmapButtonCtrl(server11gui @ %i)
{
profile = "GuiDefaultProfile";
horizSizing = "right";
vertSizing = "bottom";
// ypos = 129 + 45*%i;
position = "185" SPC 129+45*%i;
extent = "191 45";
minExtent = "8 2";
visible = "1";
command = "CuiBitmapButtonCtrl::GetServerSN();";
text = "Button";
groupNum = "-1";
buttonType = "PushButton";
bitmap = "./gui/guiimage/login/f_006";
sn = %i;
};
login.add(server11gui @ %i);
}
HEHEHE,I can dynamic create the obj at run time.
07/05/2005 (4:01 am)
This method don't fit my require.I have find a method:
for(%i = 0; %i<$g_ServerNum;%i++)
{
new GuiBitmapButtonCtrl(server11gui @ %i)
{
profile = "GuiDefaultProfile";
horizSizing = "right";
vertSizing = "bottom";
// ypos = 129 + 45*%i;
position = "185" SPC 129+45*%i;
extent = "191 45";
minExtent = "8 2";
visible = "1";
command = "CuiBitmapButtonCtrl::GetServerSN();";
text = "Button";
groupNum = "-1";
buttonType = "PushButton";
bitmap = "./gui/guiimage/login/f_006";
sn = %i;
};
login.add(server11gui @ %i);
}
HEHEHE,I can dynamic create the obj at run time.
Associate Ian Omroth Hardingham
Mode 7 Games
Ian