Author Topic: GUI Help.  (Read 1334 times)

How can key bind my GUI? I have the code where it appears in the controls menu but when I make a key bind for it, it does not appear on my screen in game.

Code: [Select]
function toggleMyGui(%tog)
{
if(%tog)
canvas.pushDialog(MyGui);
else
canvas.popDialog(MyGui);
}
if(!$MyGuiBound)
{
$RemapDivision[$RemapCount] = "My Gui Category";
$RemapName[$RemapCount] = "Open My Gui";
$RemapCmd[$RemapCount++-1] = "toggleMyGui";
$MyGuiBound = 1;
}


Code: [Select]
function toggleMyGui(%tog)
{
if(%tog)
canvas.pushDialog(MyGui);
else
canvas.popDialog(MyGui);
}
if(!$MyGuiBound)
{
$RemapDivision[$RemapCount] = "My Gui Category";
$RemapName[$RemapCount] = "Open My Gui";
$RemapCmd[$RemapCount++-1] = "toggleMyGui";
$MyGuiBound = 1;
}

K thank you,  I also have one more problem. When ever I load my gui, and try to drag it  around, the button just stays in one spot, it  doesn't move with my gui window. if I try to move it back to it's place, instead the button goes behind it.
« Last Edit: November 11, 2012, 09:45:10 AM by Skelesys »

Gotta parent the button to the window
When in GUI editor, right click window before placing button.