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 06-27-2011, 06:33 PM
callimuc callimuc is offline
callimuc's Avatar
Join Date: Nov 2010
Location: Germany
Posts: 1,015
callimuc is a splendid one to beholdcallimuc is a splendid one to beholdcallimuc is a splendid one to beholdcallimuc is a splendid one to beholdcallimuc is a splendid one to behold
GUI image changing

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:

Name:  guibutton.png
Views: 180
Size:  1.1 KB

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";
    } 
__________________
MEEP!
Reply With Quote
  #2  
Old 06-27-2011, 07:45 PM
fowlplay4 fowlplay4 is offline
team canada
fowlplay4's Avatar
Join Date: Jul 2004
Location: Canada
Posts: 5,200
fowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond repute
Try setting:

profile.fontStyle = "bc";
profile.align = "center";
__________________
Quote:
Reply With Quote
  #3  
Old 06-27-2011, 08:19 PM
callimuc callimuc is offline
callimuc's Avatar
Join Date: Nov 2010
Location: Germany
Posts: 1,015
callimuc is a splendid one to beholdcallimuc is a splendid one to beholdcallimuc is a splendid one to beholdcallimuc is a splendid one to beholdcallimuc is a splendid one to behold
oh ok thx
__________________
MEEP!
Reply With Quote
  #4  
Old 06-27-2011, 08:31 PM
fowlplay4 fowlplay4 is offline
team canada
fowlplay4's Avatar
Join Date: Jul 2004
Location: Canada
Posts: 5,200
fowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond repute
You should still set a profile when you use useownprofile. I.e:

profile = GuiButtonProfile;
__________________
Quote:
Reply With Quote
  #5  
Old 06-27-2011, 08:50 PM
callimuc callimuc is offline
callimuc's Avatar
Join Date: Nov 2010
Location: Germany
Posts: 1,015
callimuc is a splendid one to beholdcallimuc is a splendid one to beholdcallimuc is a splendid one to beholdcallimuc is a splendid one to beholdcallimuc is a splendid one to behold
Oh ok. I thought its useless since i made useOwnProfile = true;
__________________
MEEP!
Reply With Quote
  #6  
Old 06-27-2011, 09:09 PM
fowlplay4 fowlplay4 is offline
team canada
fowlplay4's Avatar
Join Date: Jul 2004
Location: Canada
Posts: 5,200
fowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond repute
Quote:
Originally Posted by callimuc View Post
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 ...
  
}

__________________
Quote:
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 01:27 PM.


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