Graal Forums

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

Gman4pwnu 03-26-2005 10:29 AM

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.

falco10291029 03-26-2005 07:43 PM

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.

Gman4pwnu 03-26-2005 07:48 PM

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?

falco10291029 03-26-2005 08:11 PM

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.

Gman4pwnu 03-26-2005 09:23 PM

Where would it be under?

Admins 03-26-2005 10:45 PM

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

Andares 03-26-2005 11:19 PM

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?

Admins 03-26-2005 11:24 PM

1 Attachment(s)
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}

falco10291029 03-26-2005 11:42 PM

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?

Gman4pwnu 03-27-2005 03:54 AM

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?

Ajira 03-27-2005 06:06 AM

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.

Gman4pwnu 03-27-2005 11:38 AM

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

Admins 03-27-2005 05:06 PM

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.

protagonist 03-27-2005 05:26 PM

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;?

Ajira 03-27-2005 06:04 PM

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.

falco10291029 03-27-2005 07:23 PM

ok thanks

Admins 03-30-2005 12:04 AM

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

Admins 09-05-2005 11:12 PM

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".

Torankusu_2002 10-03-2005 05:53 PM

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?

Riot 10-03-2005 05:56 PM

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:
http://riot.delteria.com/gui_normprofile.png
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:
http://riot.delteria.com/gui_ownprofile.png
The text now contains all the information contained in "GuiTextProfile" only changing the color and size.

Torankusu_2002 10-03-2005 07:28 PM

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.

ForgottenLegacy 10-04-2005 01:41 AM

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.

Torankusu_2002 10-04-2005 05:28 AM

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.

napo_p2p 10-04-2005 06:00 AM

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.

ForgottenLegacy 10-05-2005 12:37 AM

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?

Admins 10-05-2005 03:12 AM

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.


All times are GMT +2. The time now is 09:03 PM.

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