Graal Forums

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

callimuc 06-27-2011 06:33 PM

GUI image changing
 
1 Attachment(s)
Hey there. After I was reading a tutorial how to change the default GUI images, I was trying out on that. But when I wanted to try out on buttons, I got the following fail. Idk if its with more GUI tools.
The text of the GUI button isnīt centered anymore. Itīs aligned left now.
Here is a small screenshot:

Attachment 53112

When I use the default GUI style, everything works fine. Hereīs the script part:

PHP Code:

    new GuiButtonCtrl("TestDesignButton") {
      
useOwnProfile true;
      
profile.bitmap "callimuc_guibutton-profile.png";
      
//even tried profile.bitmap = "callimuc_guibutton-profile"; also shows the image but also with the fail
      
profile.fontSize 12;
      
profile.fontStyle "b";
      
profile.fontType "Arial";
      
6;
      
130;
      
position = {6130};
      
extent = {8820};
      
text "Load";
    } 


fowlplay4 06-27-2011 07:45 PM

Try setting:

profile.fontStyle = "bc";
profile.align = "center";

callimuc 06-27-2011 08:19 PM

oh ok thx

fowlplay4 06-27-2011 08:31 PM

You should still set a profile when you use useownprofile. I.e:

profile = GuiButtonProfile;

callimuc 06-27-2011 08:50 PM

Oh ok. I thought its useless since i made useOwnProfile = true;

fowlplay4 06-27-2011 09:09 PM

Quote:

Originally Posted by callimuc (Post 1656456)
Oh ok. I thought its useless since i made useOwnProfile = true;

Nope, it provides the base and makes it easier for you to extend profiles in the long run since you won't have to redefine variables that would already be set in an existing profile.

You can also make your own profiles so you don't have to use 'useownprofile' in every button you make. I.e:

Weapon: -Profiles

PHP Code:

//#CLIENTSIDE
function onCreated() {
  new 
GuiButtonProfile("MyServerButtonProfile") {
    
bitmap "someotherbitmap";
    
fontcolor "255 0 0"// Actual values may vary
  
}


Example Weapon:

PHP Code:

//#CLIENTSIDE
function onCreated() {
  new 
GuiButtonCtrl("MyButton") {
    
profile MyServerButtonProfile;
    
// other variables ...
  
}




All times are GMT +2. The time now is 12:32 AM.

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