Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   New Scripting Engine (GS2) (https://forums.graalonline.com/forums/forumdisplay.php?f=153)
-   -   zoom in gui window (https://forums.graalonline.com/forums/showthread.php?t=63434)

Prozac 01-14-2006 04:49 PM

zoom in gui window
 
Just a simple script that not fully functional, to comply with forum rules, since it does not have any actual useful information in the contents of the window.
Also as a brief explination to those new to scripting and gs2 of some of the basic commands. Kind of a neat effect.

PHP Code:

//#CLIENTSIDE
// by Prozac
function onWeaponFired(){onCreated();} //this line causes the window to open whenever the player logs in, or when the player selects the npc and presses D

function onCreated()
 {
 new 
GuiWindowCtrl("zoom_window")  // this makes a new window with the name zoom_window. The quotes tell the script to interpret the window name as a string.
   
{    
    
width = 1;   //width ahd height tell the script how high and wide to make the window.
    
height = 1;

    
x = (screenwidth - width) / 2;    //the x and y are where on the screen the top left corner of the window appears.
    
y = (screenheight - height) / 2;  //half of the screen height and width is the center of the screen.

    
canMove = true;      //affects ability to move the window
    
canResize = false;   //these are fairly self explanitory paramaters...
    
canMaximize = false;
    
canClose = true;
    
tile = true;
    
text = "Zoom Window";  //text in the top left title bar of the window
    
visible = true;
  }


 for (
this.i=0; this.i<100; this.i++)
  {
   
//you can modify the attributes of a window with windowname.attribute, as seen here.
   
zoom_window.width+=5;
   
zoom_window.height+=5;
   
zoom_window.x = (screenwidth - zoom_window.width) / 2;
   
zoom_window.y = (screenheight - zoom_window.height) / 2;
   
sleep .05;   // this mades for a gradual expansion of the window instead of expanding it all at once
  
}

} 


ApothiX 01-14-2006 06:20 PM

Uhh okay? You should probably use a timeout instead of a for loop with sleep, though.

Admins 01-14-2006 06:24 PM

Nice script :)
May be a little improvement for better readibility:

PHP Code:

with (zoom_window) {
   
width+=5;
   
height+=5;
   
x = (screenwidth - width) / 2;
   
y = (screenheight - height) / 2; 
} 



All times are GMT +2. The time now is 08:15 PM.

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