Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   Help with GUI (https://forums.graalonline.com/forums/showthread.php?t=64976)

protagonist 03-27-2006 02:35 AM

Help with GUI
 
NPC Code:

//#CLIENTSIDE

function onWeaponFired(){
new GuiWindowCtrl(WindowTest){
extent = {140,62};
position = {50,50};

text = "Test Window";

new GuiButtonCtrl(Okay){
position = {6,24};
extent = {128,32};

text = "Okay!";
}
}
}
function WindowTest.onAction(){
WindowTest.destroy;
}




What's wrong with it?

Ajira 03-27-2006 03:29 AM

You might mean to use Okay.onAction() as that is the actual button control, that is if you want the window to close when you click the button. Currently, WindowTest.onAction() is checking some action with the window itself, which I don't think happens. :o

protagonist 03-28-2006 12:42 AM

But shouldn't it still be created? It's not even popping up.

ApothiX 03-28-2006 01:01 AM

Quote:

Originally Posted by protagonist
But shouldn't it still be created? It's not even popping up.

You're not giving it a profile to use.

add: profile = "GuiBlueWindowProfile"; to the window, and: profile = "GuiBlueButtonProfile" to the button.

Ajira 03-28-2006 01:46 AM

Quote:

Originally Posted by ApothiX
You're not giving it a profile to use.

add: profile = "GuiBlueWindowProfile"; to the window, and: profile = "GuiBlueButtonProfile" to the button.

What if he doesn't like blue!

Bl0nkt 03-28-2006 01:51 AM

NPC Code:

new GuiWindowCtrl("WindowTest"){


In the function creating the new window, WindowTest would be a string. You need quotations.

ApothiX 03-30-2006 04:00 PM

Quote:

Originally Posted by Bl0nkt
NPC Code:

new GuiWindowCtrl("WindowTest"){


In the function creating the new window, WindowTest would be a string. You need quotations.

No, it doesn't have to have quotes around it. Most people prefer not to put quotes, for some odd reason.


Quote:

Originally Posted by Ajira
What if he doesn't like blue!

Then that's too bad for him!

Yen 03-30-2006 08:40 PM

I _BELIEVE_ the only arrays used in GUI controls are the rows object.

In which case, extent would be "min max", not {min,max};

Alternative, you could set x, y, width, and height. I personally don't like using extent and such.

Skyld 03-30-2006 08:49 PM

Quote:

Originally Posted by Yen
I _BELIEVE_ the only arrays used in GUI controls are the rows object.

In which case, extent would be "min max", not {min,max};

Alternative, you could set x, y, width, and height. I personally don't like using extent and such.

Arrays are probably more effective for setting these values. The "vector" datatype that people use (for example, "min max") are essentially converted into arrays anyway.


All times are GMT +2. The time now is 02:11 PM.

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