Author Topic: BLIVE_WINDOW_MAIN fills the whole screen  (Read 751 times)

Why does this GUI, when called to open, fill up the whole screen rather than be 320*240 pixels? BLIVE_MAIN and BLIVE_WINDOW_MAIN are only supposed to occupy 320*240 pixels.

Also, is there any sort of way to horizontally and vertically center the BLIVE_WINDOW_MAIN window on the canvas when it opens? Can math or a variable be inserted into the extent field to dynamically calculate the position based on division?

Code: [Select]
// function OPEN_ALERT_HELP()
// {
// open the help gui
// }
// function OPEN_ALERT_ADDONS()
// {
// open the addons gui that says "it hasnt been made yet"
// }

//--- OBJECT WRITE BEGIN ---
new GuiControl(BLIVE_MAIN) {
   profile = "GuiDefaultProfile";
   horizSizing = "right";
   vertSizing = "bottom";
   position = "0 0";
   extent = "320 240";
   minExtent = "8 2";
   enabled = "1";
   visible = "1";
   clipToParent = "1";

   new GuiWindowCtrl(BLIVE_WINDOW_MAIN) {
      profile = "GuiWindowProfile";
      horizSizing = "right";
      vertSizing = "bottom";
      position = "0 0";
      extent = "320 240";
      minExtent = "8 2";
      enabled = "1";
      visible = "1";
      clipToParent = "1";
      text = "BLIVE";
      maxLength = "255";
      resizeWidth = "0";
      resizeHeight = "0";
      canMove = "1";
      canClose = "1";
      canMinimize = "0";
      canMaximize = "0";
      minSize = "50 50";
      closeCommand = "Canvas.popDialog(BLIVE_WINDOW_MAIN);";

      new GuiBitmapButtonCtrl() {
         profile = "BlockButtonProfile";
         horizSizing = "right";
         vertSizing = "bottom";
         position = "40 145";
         extent = "75 30";
         minExtent = "8 2";
         enabled = "1";
         visible = "1";
         clipToParent = "1";
         command = "Canvas.popDialog(BLIVE_WINDOW_MAIN);";
         accelerator = "escape";
         text = "Close";
         groupNum = "-1";
         buttonType = "PushButton";
         bitmap = "base/client/ui/button2";
         lockAspectRatio = "1";
         alignLeft = "0";
         alignTop = "0";
         overflowImage = "0";
         mKeepCached = "0";
         mColor = "255 255 255 255";
      };
      new GuiBitmapButtonCtrl() {
         profile = "BlockButtonProfile";
         horizSizing = "right";
         vertSizing = "bottom";
         position = "205 145";
         extent = "75 30";
         minExtent = "8 2";
         enabled = "1";
         visible = "1";
         clipToParent = "1";
         command = "";
         accelerator = "enter";
         text = "Addons";
         groupNum = "-1";
         buttonType = "PushButton";
         bitmap = "base/client/ui/button2";
         lockAspectRatio = "1";
         alignLeft = "0";
         alignTop = "0";
         overflowImage = "0";
         mKeepCached = "0";
         mColor = "255 255 255 255";
      };
      new GuiBitmapButtonCtrl() {
         profile = "BlockButtonProfile";
         horizSizing = "right";
         vertSizing = "bottom";
         position = "122 145";
         extent = "75 30";
         minExtent = "8 2";
         enabled = "1";
         visible = "1";
         clipToParent = "1";
         command = "";
         accelerator = "?";
         text = "Manual";
         groupNum = "-1";
         buttonType = "PushButton";
         bitmap = "base/client/ui/button2";
         lockAspectRatio = "1";
         alignLeft = "0";
         alignTop = "0";
         overflowImage = "0";
         mKeepCached = "0";
         mColor = "255 255 255 255";
      };
      new GuiTextCtrl() {
         profile = "GuiBigTextProfile";
         horizSizing = "right";
         vertSizing = "bottom";
         position = "74 78";
         extent = "171 40";
         minExtent = "8 2";
         enabled = "1";
         visible = "1";
         clipToParent = "1";
         text = "BLIVE";
         maxLength = "255";
      };
   };
};
//--- OBJECT WRITE END ---

function OPEN_BLIVE_WINDOW()
{
Canvas.pushDialog(BLIVE_WINDOW_MAIN);
}

Objects pushed to the canvas fills the screen, which is why GUIs are usually placed in a GuiControl first.
Change Canvas.pushDialog(BLIVE_WINDOW_MAIN); to Canvas.pushDialog(BLIVE_MAIN);

Objects pushed to the canvas fills the screen, which is why GUIs are usually placed in a GuiControl first.
Change Canvas.pushDialog(BLIVE_WINDOW_MAIN); to Canvas.pushDialog(BLIVE_MAIN);

thanks