Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   Code Gallery (https://forums.graalonline.com/forums/forumdisplay.php?f=179)
-   -   Gui Profiles (https://forums.graalonline.com/forums/showthread.php?t=74558)

xAndrewx 06-12-2007 07:50 PM

Gui Profiles
 
2 Attachment(s)
Well, here's what I did. From this script you'll see how to draw gui profiles in many different ways. Have fun!

HTML Code:

//#CLIENTSIDE
function onCreated()
{
  seteffect(0, 0, 0, 1);
 
  scheduleevent(0.5, "drawMENU", "");
}

function ondrawMENU()
{
  new GuiWindowCtrl("loginMain")
  {
    useownprofile = true;
    profile.bitmap = "c_guibackground_bank.png";
   
    width = 200;
    height = 150;
   
    //Used a public function here, just returns the center position from the window width and height
    temp.windowData = core.getCenter(loginMain.width, loginMain.height);   
   
    x = temp.windowData[0];
    y = temp.windowData[1];
   
    new GuiMLTextCtrl("loginText")
    {
      useownprofile = true;
      with (profile)
      {
        fontcolor = {255, 255, 255, 255};
        fontSize = 30;
        fontStyle = "b";
        fontType = "Impact";
        shadowColor = {25, 25, 25, 255};
        shadowOffset = {2, 2};
        textShadow = true;
      }
      x = 33;
      y = 25;
      width = 180;
      height = 60;
      text = "Vendict Login";
    }

    temp.textEdits = {
      {"accountName", "Account Name", {
        {"fillColor", "{80, 180, 102, 50}"},
        {"fontColor", "{255, 255, 255, 255}"},
        {"fontType", "Arial"},
        {"fontStyle", "b"},
        {"fontSize", 15},
        {"shadowOffset", "{2, 2}"},
        {"textShadow", true},
        {"opaque", true}
      }, 15, 55, 170, 20},
     
      {"accountPassword", "Account Password", {
        {"fillColor", "{80, 180, 102, 50}"},
        {"fontColor", "{255, 255, 255, 255}"},
        {"fontType", "Arial"},
        {"fontStyle", "b"},
        {"fontSize", 15},
        {"shadowOffset", "{2, 2}"},
        {"textShadow", true},
        {"opaque", true}
      }, 15, 80, 170, 20}
    };
    for (temp.currentBox: temp.textEdits)
    {
      new GuiTextEditCtrl(temp.currentBox[0])
      {
        useownprofile = true;
        text = temp.currentBox[1];
        with(profile)
        {
          for (temp.currentControl: temp.currentBox[2])
          {
            (@ temp.currentControl[0]) = (@ temp.currentControl[1]);
          }
        }
        x = temp.currentBox[3];
        y = temp.currentBox[4];
        width = temp.currentBox[5];
        height = temp.currentBox[6];
      }
    }
    new GuiMLTextCtrl("playText")
    {
      useownprofile = true;
      profile.fontcolorlink = {0, 255, 0, 55};
      profile.fontSize = 30;
      profile.fontStyle = "b";
      profile.fontType = "Impact";
      profile.shadowColor = {25, 25, 25, 255};
      profile.shadowOffset = {2, 2};
      profile.textShadow = true;

      x = 53;
      y = 100;
      width = 180;
      height = 60;

      //Remember this part!
      text = "<a href=doAction>Play Now</a>";
    }     
  }
}

//Remember the  "<a href=doAction>" part? Here's that function process!
function playText.onURL(urlName)
{
  if (temp.urlName == "doAction")
  {
    echo("Doing the login process!");
  }
}

Here's a snapshot and the gui profile I used!

theHAWKER 06-13-2007 04:01 AM

cool, but i don't like the slanted corners everyone uses >:(
but nice job :D


All times are GMT +2. The time now is 03:55 AM.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.