[Tutorial] Creating A GUI [Updated 4/1/2012]

Poll

Did this tutorial help?

Yes
28 (56%)
No
7 (14%)
Somewhat
15 (30%)

Total Members Voted: 50

Author Topic: [Tutorial] Creating A GUI [Updated 4/1/2012]  (Read 13143 times)




Added a guide to finding (and modifying) controls with no name.

Yay. This will help greatly.



Thanks I really like this! The only problem I had was when creating the first button I cannot find the "mColor" thing.
And I added the extra coding except it still doesnt seem to open.

Did you use a GuiButtonCtrl, to use mColor you need to be editing a GuiBitmapButtonCtrl

Did you use a GuiButtonCtrl, to use mColor you need to be editing a GuiBitmapButtonCtrl
Oh, that could be why. Thanks

Now I just need to know how to open my GUI

Oh, that could be why. Thanks

Now I just need to know how to open my GUI
canvas.pushDialog(guiName);
canvas.pushdialog(escapeMenu);
for example

My GUI mapping controls are still not showing up under the control tab.  files from my "Client_Test" zip folder.
My client.cs

exec("./Test.gui");

    $remapDivision[$remapCount] = "Category";
    $remapName[$remapCount] = "Action";
    $remapCmd[$remapCount] = "Open_Test";
    $remapCount++;

My Test.gui

//--- OBJECT WRITE BEGIN ---
new GuiControl(Test) {
   profile = "GuiDefaultProfile";
   horizSizing = "right";
   vertSizing = "bottom";
   position = "0 0";
   extent = "640 480";
   minExtent = "8 2";
   visible = "1";

   new GuiWindowCtrl(Test) {
      profile = "GuiWindowProfile";
      horizSizing = "right";
      vertSizing = "bottom";
      position = "0 0";
      extent = "334 408";
      minExtent = "8 2";
      visible = "1";
      accelerator = "escape";
      text = "Test";
      maxLength = "255";
      resizeWidth = "1";
      resizeHeight = "1";
      canMove = "1";
      canClose = "1";
      canMinimize = "1";
      canMaximize = "1";
      minSize = "50 50";
      closeCommand = "canvas.popDialog(TestGui);";

      new GuiBitmapButtonCtrl(Button) {
         profile = "BlockButtonProfile";
         horizSizing = "right";
         vertSizing = "bottom";
         position = "82 61";
         extent = "140 30";
         minExtent = "8 2";
         visible = "1";
         command = "TestButtonPush();";
         text = "Button";
         groupNum = "-1";
         buttonType = "PushButton";
         bitmap = " base/client/ui/button2";
         lockAspectRatio = "0";
         alignLeft = "0";
         overflowImage = "0";
         mKeepCached = "0";
         mColor = "255 25 25 255";
      };
   };
};
//--- OBJECT WRITE END ---
function Open_Test(%Gui)
{
   %Gui = canvas.pushDialog(TestGui);
}

Double bump.
I got it to work by barely following AGlassOfMilk's tutorial

Instead of Client_ I used Script_ and it worked!

Double bump.
I got it to work by barely following AGlassOfMilk's tutorial

Instead of Client_ I used Script_ and it worked!

That shouldn't make a difference

Probably restarting blockland fixed it

That shouldn't make a difference

Probably restarting blockland fixed it
I dont know because Ive been doing all this afternoon with no luck until just now

Testing out another one based off of the Admin gui