Game Development Community

is there a HUD gui tutorial for TGB 1.7.5?

by yanghantao · in Torque Game Builder · 11/03/2011 (11:05 pm) · 1 replies

TDN or online documents seem to be a little out of date, it looks unlike the GUI Editor in TGB 1.7.5


i follow a tutorial, make a gui and save it. then in main.cs , exec it.
finally, in game.cs, use pushDialog


the gui appear, but it's not in the position in GUI Editor. i set the root guiControl's position to 0,500 and extend set to 800,100. hoping it would appear in the buttom of screen.

but in game, it's on top, positon 0,0 and extend 800,600, same as my screen.

so i open it again in GUI Editor, it's 0,0 and 800,600. but it is 0,500 and 800,100 in gui file!
i didn't modify anything, save it again. gui file change to 0,0 and 800,600 ...

it is a bug?


and , i wish to make a HUD gui with some button. but when the gui appear, my game don't accept mouse event any more.

i try to modify the source code, make a new findHitControl function for t2dSceneWindow. but since the root control with change its size, it failed....


#1
11/03/2011 (11:08 pm)
here is my gui file:

//--- OBJECT WRITE BEGIN ---
%guiContent = new GuiControl(MenuShell) {
canSaveDynamicFields = "0";
isContainer = "1";
Profile = "GuiDefaultProfile";
HorizSizing = "right";
VertSizing = "bottom";
Position = "0 500"; //this will change to "0 0" when i reopen this file in GUI Editor and save it again
Extent = "800 100"; //this will change to "800 600" when i reopen this file in GUI Editor and save it again
MinExtent = "8 2";
canSave = "1";
Visible = "1";
hovertime = "1000";


new GuiButtonCtrl(button1) {
canSaveDynamicFields = "0";
isContainer = "0";
Profile = "GuiButtonProfile";
HorizSizing = "right";
VertSizing = "bottom";
Position = "421 397";
Extent = "140 30";
MinExtent = "8 2";
canSave = "1";
Visible = "1";
hovertime = "1000";
groupNum = "-1";
buttonType = "PushButton";
useMouseEvents = "0";

};
};
//--- OBJECT WRITE END ---