Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting
FAQ Members List Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 03-26-2005, 10:29 AM
Gman4pwnu Gman4pwnu is offline
Banned
Join Date: Jan 2004
Posts: 434
Gman4pwnu is on a distinguished road
Send a message via AIM to Gman4pwnu
Graal3 GUI

I noticed that you could create your own GUI like the playerlist with graal3. What I was wondering is if we could customize the graphics for the graal3 GUI? It just wouldn't fit in well with servers with differant themes.
Reply With Quote
  #2  
Old 03-26-2005, 07:43 PM
falco10291029 falco10291029 is offline
BEst User EVER!
Join Date: Apr 2004
Posts: 1,186
falco10291029 is on a distinguished road
Im not sure the exact command, you can look it upo in a document, but it's like newguibitmapwindow(), and then there's a value you set for the image name.
__________________
BEst Insult ever: If I had a dollar for every brain you DIDNT have, i'd have one dollar!
Reply With Quote
  #3  
Old 03-26-2005, 07:48 PM
Gman4pwnu Gman4pwnu is offline
Banned
Join Date: Jan 2004
Posts: 434
Gman4pwnu is on a distinguished road
Send a message via AIM to Gman4pwnu
yes but im sure they use multiple images for like the sides, bottom and top, and the filling as well as buttons... Where would the template for those be?
Reply With Quote
  #4  
Old 03-26-2005, 08:11 PM
falco10291029 falco10291029 is offline
BEst User EVER!
Join Date: Apr 2004
Posts: 1,186
falco10291029 is on a distinguished road
Hmm, well for the buttons, its newguibitmapbuttonctrl or something, and as for the multiple images, you'll need to contact sterfan or soemone else who would know. I myself will look to see what I can figure out.
__________________
BEst Insult ever: If I had a dollar for every brain you DIDNT have, i'd have one dollar!
Reply With Quote
  #5  
Old 03-26-2005, 09:23 PM
Gman4pwnu Gman4pwnu is offline
Banned
Join Date: Jan 2004
Posts: 434
Gman4pwnu is on a distinguished road
Send a message via AIM to Gman4pwnu
Where would it be under?
Reply With Quote
  #6  
Old 03-26-2005, 10:45 PM
Admins Admins is offline
Graal Administration
Join Date: Jan 2000
Location: Admins
Posts: 11,693
Admins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud of
You can create new profiles. If you want to base it on an existing profile and only modify a few values, you could e.g. do
new GuiTextProfile("MyBigTextProfile") {
fontsize = 30;
}

and in the gui object then do
profile = MyBigTextProfile;

From the docu you can get the attributes of a profile:
GuiControlProfile:
autosizeheight - boolean
autosizewidth - boolean
bitmap - string
border - integer
bordercolor - string
bordercolorhl - string
bordercolorna - string
borderthickness - integer
cankeyfocus - boolean
cursorcolor - string
fillcolor - string
fillcolorhl - string
fillcolorna - string
fontcolor - string
fontcolorhl - string
fontcolorlink - string
fontcolorlinkhl - string
fontcolorna - string
fontcolorsel - string
fontsize - integer
fonttype - string
justify - string
linespacing - integer
modal - boolean
mouseoverselected - boolean
numbersonly - boolean
opaque - boolean
returntab - boolean
soundbuttondown - string
soundbuttonover - string
tab - boolean
textoffset - string
transparency - float

The bitmap defines what look the window, text field, scroll bar etc. gets
Reply With Quote
  #7  
Old 03-26-2005, 11:19 PM
Andares Andares is offline
Scr1pt3r-ish
Andares's Avatar
Join Date: Mar 2004
Posts: 55
Andares is on a distinguished road
Send a message via AIM to Andares
Quote:
Originally Posted by Stefan
You can create new profiles. If you want to base it on an existing profile and only modify a few values, you could e.g. do
new GuiTextProfile("MyBigTextProfile") {
fontsize = 30;
}

and in the gui object then do
profile = MyBigTextProfile;

From the docu you can get the attributes of a profile:
GuiControlProfile:
autosizeheight - boolean
autosizewidth - boolean
bitmap - string
border - integer
bordercolor - string
bordercolorhl - string
bordercolorna - string
borderthickness - integer
cankeyfocus - boolean
cursorcolor - string
fillcolor - string
fillcolorhl - string
fillcolorna - string
fontcolor - string
fontcolorhl - string
fontcolorlink - string
fontcolorlinkhl - string
fontcolorna - string
fontcolorsel - string
fontsize - integer
fonttype - string
justify - string
linespacing - integer
modal - boolean
mouseoverselected - boolean
numbersonly - boolean
opaque - boolean
returntab - boolean
soundbuttondown - string
soundbuttonover - string
tab - boolean
textoffset - string
transparency - float

The bitmap defines what look the window, text field, scroll bar etc. gets
Any chance you could post the code of the other profiles?
__________________
Quote:
<Wan> Can I have a poll? Do people mind if I talk about sexual intercourse between two human beings?
<Kai> Wan, I think the problem is that it's basically ALL you talk about
<Wan> Ahhhhhh
Aim: AtariTandy | Job: Sanstrata)
Reply With Quote
  #8  
Old 03-26-2005, 11:24 PM
Admins Admins is offline
Graal Administration
Join Date: Jan 2000
Location: Admins
Posts: 11,693
Admins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud of
Ok here. Colors are often having values like "255 255 255" but are basicly an array of 3 values, you can also write "255,255,255" or {255,255,255}
Attached Files
File Type: txt profiles.txt (9.5 KB, 491 views)
Reply With Quote
  #9  
Old 03-26-2005, 11:42 PM
falco10291029 falco10291029 is offline
BEst User EVER!
Join Date: Apr 2004
Posts: 1,186
falco10291029 is on a distinguished road
Wow now if i ever need a better gui I can make one


Care tyo tell the command on how to get rid of the x, -, and + so that you cant delete the window?
__________________
BEst Insult ever: If I had a dollar for every brain you DIDNT have, i'd have one dollar!
Reply With Quote
  #10  
Old 03-27-2005, 03:54 AM
Gman4pwnu Gman4pwnu is offline
Banned
Join Date: Jan 2004
Posts: 434
Gman4pwnu is on a distinguished road
Send a message via AIM to Gman4pwnu
What is the name of the image with the look of the GUI though stefan? And where is it found in the graal folder?

Edit:

graal2001\levels3d\gui
is where I found it... we can specify the imagenames to use for gui?
Reply With Quote
  #11  
Old 03-27-2005, 06:06 AM
Ajira Ajira is offline
Poont.
Join Date: Oct 2004
Location: NY, USA
Posts: 477
Ajira is on a distinguished road
Quote:
Originally Posted by Gman4pwnu
is where I found it... we can specify the imagenames to use for gui?
He already explained it. 'bitmap' is the string used to define the image used for the border, scroll, etc.
__________________
Liek omigosh.

Reply With Quote
  #12  
Old 03-27-2005, 11:38 AM
Gman4pwnu Gman4pwnu is offline
Banned
Join Date: Jan 2004
Posts: 434
Gman4pwnu is on a distinguished road
Send a message via AIM to Gman4pwnu
Quote:
Originally Posted by Ajira
He already explained it. 'bitmap' is the string used to define the image used for the border, scroll, etc.
sorry, not so proficient with GS2.

Goin to have jacco teach me :P
Reply With Quote
  #13  
Old 03-27-2005, 05:06 PM
Admins Admins is offline
Graal Administration
Join Date: Jan 2000
Location: Admins
Posts: 11,693
Admins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud of
To specify which window buttons are visible use the attributes canmove, canclose, canminimize, canmaximize

The default gfx for the gui are in levels3d/gui, if you want to make your own then you can base it one of those. Each gfx contains several "subgfx" which are put in the image file in a grid.
Reply With Quote
  #14  
Old 03-27-2005, 05:26 PM
protagonist protagonist is offline
Banned
protagonist's Avatar
Join Date: May 2003
Location: CAW
Posts: 5,586
protagonist is on a distinguished road
Send a message via AIM to protagonist Send a message via MSN to protagonist
Quote:
Originally Posted by falco10291029
Care tyo tell the command on how to get rid of the x, -, and + so that you cant delete the window?
I don't know how you get rid of the top bar, but maybe something like canclose = false;?
Reply With Quote
  #15  
Old 03-27-2005, 06:04 PM
Ajira Ajira is offline
Poont.
Join Date: Oct 2004
Location: NY, USA
Posts: 477
Ajira is on a distinguished road
Quote:
Originally Posted by protagonist
I don't know how you get rid of the top bar, but maybe something like canclose = false;?
You can't get rid of it, unless you edit it out of the image. But using canclose = canmaximize = canminimize = false; will get rid of the buttons.
__________________
Liek omigosh.

Reply With Quote
  #16  
Old 03-27-2005, 07:23 PM
falco10291029 falco10291029 is offline
BEst User EVER!
Join Date: Apr 2004
Posts: 1,186
falco10291029 is on a distinguished road
ok thanks
__________________
BEst Insult ever: If I had a dollar for every brain you DIDNT have, i'd have one dollar!
Reply With Quote
  #17  
Old 03-30-2005, 12:04 AM
Admins Admins is offline
Graal Administration
Join Date: Jan 2000
Location: Admins
Posts: 11,693
Admins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud of
Quote:
Originally Posted by protagonist
I don't know how you get rid of the top bar, but maybe something like canclose = false;?
If you don't wan't the title then just use any other control, set "canmove = true;" or "canresize = true;" to be able to move and resize it like a normal window
Reply With Quote
  #18  
Old 09-05-2005, 11:12 PM
Admins Admins is offline
Graal Administration
Join Date: Jan 2000
Location: Admins
Posts: 11,693
Admins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud of
Update for profiles:
You can change the color of a gui object without creating a new profile now:

PHP Code:
new GuiTextCtrl("MyText") {
  
100;
  
profile "GuiTextProfile";
  
useownprofile true;
  
profile.fontColor = {0,0,255};

When setting "useownprofile = true" then the gui object will create a new profile, copying the existing profile you have specified. All further profile modifications will only affect the current gui object. In this example it is setting the font color to "blue".
Reply With Quote
  #19  
Old 10-03-2005, 05:53 PM
Torankusu_2002 Torankusu_2002 is offline
'been round.
Torankusu_2002's Avatar
Join Date: Nov 2001
Posts: 1,246
Torankusu_2002 is on a distinguished road
Quote:
Originally Posted by Stefan
Update for profiles:
You can change the color of a gui object without creating a new profile now:

PHP Code:
new GuiTextCtrl("MyText") {
  
100;
  
profile "GuiTextProfile";
  
useownprofile true;
  
profile.fontColor = {0,0,255};

When setting "useownprofile = true" then the gui object will create a new profile, copying the existing profile you have specified. All further profile modifications will only affect the current gui object. In this example it is setting the font color to "blue".
Sorry, this is almost a month old, but, your example breaks down like this:

-new GuiTextCtrl("the text file the player has edited goes here") ?
profile = "GuiTextProfile"; --this is where you specify the profile to copy?

Do you have to create the new profile.txt, or will it just take the existing one and use it, but replace the images?

Where do you put these images and .txt files online and offline?
__________________
torankusu's
Reply With Quote
  #20  
Old 10-03-2005, 05:56 PM
Riot Riot is offline
Delteria Management
Join Date: Nov 2003
Location: Seminole County, Florida
Posts: 280
Riot is on a distinguished road
Quote:
Originally Posted by Torankusu_2002
Sorry, this is almost a month old, but, your example breaks down like this:

-new GuiTextCtrl("the text file the player has edited goes here") ?
profile = "GuiTextProfile"; --this is where you specify the profile to copy?

Where do you put these images and .txt files online and offline?
You're not editing any files. It's just basically dynamically changing a GUI profile (settings/colors) for the one GUI object, you shouldn't need to upload anything.

Edit:

Let's say you have this code to create a window:
NPC Code:

//#CLIENTSIDE
function onCreated() {
new GuiWindowCtrl("Test_Window") {
profile = "GuiWindowProfile";
position = "0 0";
extent = "350 350";
canMove = true;
canResize = canMaximize = canClose = false;
tile = true;
text = "Test Window";

new GuiTextCtrl("Test_Text") {
profile = "GuiTextProfile";
position = "60 30";
text = "Test";
}
}
}



It will create a window such as this:

Notice the text is fairly hard to read, now add these three lines to the "Test_Text" control to change the font color and size:
NPC Code:

useownprofile = true;
profile.fontSize = "25";
profile.fontColor = {0, 0, 0};



You get something more like this:

The text now contains all the information contained in "GuiTextProfile" only changing the color and size.

Last edited by Riot; 10-03-2005 at 06:17 PM..
Reply With Quote
  #21  
Old 10-03-2005, 07:28 PM
Torankusu_2002 Torankusu_2002 is offline
'been round.
Torankusu_2002's Avatar
Join Date: Nov 2001
Posts: 1,246
Torankusu_2002 is on a distinguished road
well, that explains it better. (still new go the gui controls).

What are the controls for changing the profile / bitmap image? (GUI Image). I was searching for those, and this thread was one of the only ones I could find. I'm trying to use my own images that I'm making.
__________________
torankusu's
Reply With Quote
  #22  
Old 10-04-2005, 01:41 AM
ForgottenLegacy ForgottenLegacy is offline
-Backtoscripts-
Join Date: Aug 2003
Location: California
Posts: 289
ForgottenLegacy is on a distinguished road
Send a message via AIM to ForgottenLegacy
Quote:
Originally Posted by Torankusu_2002
well, that explains it better. (still new go the gui controls).

What are the controls for changing the profile / bitmap image? (GUI Image). I was searching for those, and this thread was one of the only ones I could find. I'm trying to use my own images that I'm making.
PHP Code:
useownprofile true;
profile.bitmap "imagename"
The images you should look at for reference are in your Graal4\levels3d\gui\ folder.
__________________
"The higher you fly, the harder it is to breathe."

[Kaidenn] Maybe I will somehow take control of Lance's body when he isn't looking, have him log onto Kingdoms, update one script, and leave.
[Kaidenn] And leave him exactly where I found him, unchanged and completely unnaware of what just took place the last two minutes.
[GrowlZ] Lance: You might want to lock your bedroom door tonight
Reply With Quote
  #23  
Old 10-04-2005, 05:28 AM
Torankusu_2002 Torankusu_2002 is offline
'been round.
Torankusu_2002's Avatar
Join Date: Nov 2001
Posts: 1,246
Torankusu_2002 is on a distinguished road
Quote:
Originally Posted by ForgottenLegacy
PHP Code:
useownprofile true;
profile.bitmap "imagename"
The images you should look at for reference are in your Graal4\levels3d\gui\ folder.
Yeah, I see that, and I see that there is one main image that has most of the stuff on it. But what would I do if I had custom scroll buttons, etc.
__________________
torankusu's
Reply With Quote
  #24  
Old 10-04-2005, 06:00 AM
napo_p2p napo_p2p is offline
oh snaps
napo_p2p's Avatar
Join Date: Sep 2003
Location: Pismo Beach, California
Posts: 2,118
napo_p2p has a spectacular aura aboutnapo_p2p has a spectacular aura about
Send a message via AIM to napo_p2p Send a message via MSN to napo_p2p
Quote:
Originally Posted by Torankusu_2002
Yeah, I see that, and I see that there is one main image that has most of the stuff on it. But what would I do if I had custom scroll buttons, etc.
Make sure your scroll buttons follow the format of those in levels32/gui/

Then do what ForgottenLegacy said.
__________________
Scito hoc super omnia.
Haec vita est tua una sola.
Dum vita superest, utere maxime quoque puncto, momento, et hora quae habes.
Tempus neminem non manet.
Noli manere tempus.
Carpe Diem

Seize the Day.
Reply With Quote
  #25  
Old 10-05-2005, 12:37 AM
ForgottenLegacy ForgottenLegacy is offline
-Backtoscripts-
Join Date: Aug 2003
Location: California
Posts: 289
ForgottenLegacy is on a distinguished road
Send a message via AIM to ForgottenLegacy
Quote:
Originally Posted by Torankusu_2002
Yeah, I see that, and I see that there is one main image that has most of the stuff on it. But what would I do if I had custom scroll buttons, etc.
You can make several images for buttons and check boxes or so, and use that for the bitmaps, for a variety of buttons. For consistancy, you should make a GuiProfile and use that. Here's how you do it:

1) Create the profile itself, it's the 'GuiControlProfile' object, and you treat it like you do any other Gui object:
PHP Code:
new GuiControlProfile(NAME) { 
The 'NAME' is how you assign the profile, so I have my window profile named to 'KaidennWindow', and my MLText to 'KaidennMLText'. I do this because it is easier to manage and simpler to use.

2) After the first line, you look up GuiControlProfile in newfeatures_client.txt and alter whatever you please. Colours are in hex strings, like "FF 00 FF" for purple or "00 FF 00" for green.

3) Inside the thing you want to alter, like your GuiWindowCtrl for example, assign the profile:
PHP Code:
profile NAME
Remember to use quotes for 'NAME' otherwise it'll think it's a var, but you do not need quotes when you make the profile. You can still use the 'useownprofile' and 'profile.param = value' things to alter the profile for that Gui object only.

I think someone wrote a docu on profiles, anyone know who and where it is?
__________________
"The higher you fly, the harder it is to breathe."

[Kaidenn] Maybe I will somehow take control of Lance's body when he isn't looking, have him log onto Kingdoms, update one script, and leave.
[Kaidenn] And leave him exactly where I found him, unchanged and completely unnaware of what just took place the last two minutes.
[GrowlZ] Lance: You might want to lock your bedroom door tonight
Reply With Quote
  #26  
Old 10-05-2005, 03:12 AM
Admins Admins is offline
Graal Administration
Join Date: Jan 2000
Location: Admins
Posts: 11,693
Admins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud of
Quote:
Originally Posted by ForgottenLegacy
Remember to use quotes for 'NAME' otherwise it'll think it's a var
Actually the profile variable is now pointing to an object, for compatibility it is also accepting if you assign a string though, it will search for the profile object with that string as name then.

Would be good to make a docu for GUI I think, also explaining the general concept about the GUI controls, events etc. Also the gui editor needs to be updated, its almost two years old now and needs new icons and support the new controls.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


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


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