Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting > New Scripting Engine (GS2)
FAQ Members List Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 12-02-2005, 09:40 PM
prozac424242 prozac424242 is offline
Registered User
prozac424242's Avatar
Join Date: May 2001
Location: Gone crazy: back soon
Posts: 356
prozac424242 is on a distinguished road
Send a message via ICQ to prozac424242 Send a message via AIM to prozac424242
GuiScrollCtrl question

I have been researching the Gui commands on the wiki, and this is all I could find for the scroll box:
PHP Code:
    GuiScrollCtrl (GuiControl):
      
childmargin string
      constantthumbheight 
boolean
      hscrollbar 
string
      scrollpos 
string
      tile 
boolean
      vscrollbar 
string
      wheelscrolllines 
integer
      willfirstrespond 
boolean
      scrolldelta
(intint)
      
scrollto(intint
Based on that, and some othe gui commands, I was able to put this together:
The window contains the scollbox, and the scrollbox contains the text
PHP Code:
//#CLIENTSIDE

// by Prozac
// replaces the welcome server pm, so that everyone -with v4- will see it without
// having to click on the pm in the playerlist.

//with scroll window

function onCreated()
       {

      new 
GuiWindowCtrl("San_welcome")
          {
        
//profile = "GuiMLWindowProfile";
        
position "0 0";
           
width 440;
           
height400;
        
extent "440 400";
        
canMove true;
        
canResize canMaximize canClose true;
        
tile true;
        
text "Sanstrata Classic Welcome Message";
        
visible true;


   new 
GuiScrollCtrl(Scrollbox)
     {
      
position "5 24";
      
extent "430 380";
      
childmargin ="5";
      
constantthumbheight true;
      
hscrollbar "red";
      
scrollpos "gray";
      
tile true;
      
vscrollbar "hi there";
      
wheelscrolllines 400;
      
willfirstrespond false;
      
scrolldelta(100500);
      
scrollto(300500);

        new 
GuiMLTextCtrl("Welcome_msg2"
            {
          
position "0 0";
          
extent "431 473";
          
horizSizing "width";
          
vertSizing "height";
          
text "<body bgcolor=black><sbreak><shadow:1:1><shadowcolor:000000><br> I want the whole background to be black but this box will not expand downwards except for how much text you put into it<br><br><br><br><br><br><br><br>and I dont want to resort to br tags";
           }

      }
   }
 } 
But the problem is that the text extent height cannot be forced to a pixel width, it just wraps around for however much text is there, and the amount of text may vary depending on what the welcome message is. I did not find any docuemtation on how to make the window or scroll areas a different color. I can only change the color of the text area, and the text area is not going to be a constant size.

If someone knows how to please help fix this so that the whole background of the scroll/window area is always black, that would be great. (oh look! I asked nicely! )
__________________

Useful links:
Graal Stats
Client Script Functions-GS1 to GS2
Serverside Script Functions-Gscript page
Particle Engine-Player Attributes
Server Options-Admin rights-Gmaps
Quote:
Originally Posted by Admins
Thanks for developing and improving playerworlds and such
Reply With Quote
  #2  
Old 12-04-2005, 01:29 AM
ApothiX ApothiX is offline
Okiesmokie
Join Date: May 2004
Posts: 1,447
ApothiX is on a distinguished road
Quote:
Originally Posted by prozac424242
If someone knows how to please help fix this so that the whole background of the scroll/window area is always black, that would be great. (oh look! I asked nicely! )
PHP Code:
new GuiWindowProfile(MySexyWindowProfile) { .. }
new 
GuiScrollProfile(MySexyScrollProfile) { .. } 
?
__________________


[06:24:19] * Parts: Skyld (i=silent@unaffiliated/skyld) ("Perhaps Okiesmokie did not realise that I like the boys. ")
Reply With Quote
  #3  
Old 12-07-2005, 01:55 AM
Yen Yen is offline
Banned
Yen's Avatar
Join Date: Oct 2005
Location: Nova Scotia, Canada
Posts: 1,085
Yen is an unknown quantity at this point
Send a message via AIM to Yen Send a message via MSN to Yen
GuiScrollCtrl is based off the GuiControl object. It can use all variables you see under GuiControl, such as x, y, width, and height. Use them. :]

x-x Sorry, sleep deprived Yen didn't notice the main question.
Focusing on the scroll, there are many things you did wrong:


PHP Code:
hscrollbar "red";
vscrollbar "hi there"
{v,h}ScrollBar = "alwaysOn", "alwaysOff", "dynamic";
alwaysOn is default, the scroll bar is always showing.
alwaysOff hides the scroll bar at all times.
dynamic only makes the scroll bar appear if you can scroll down.

PHP Code:
scrollpos "gray"
scrollpos is how many pixels horizontally/vertically the scroll bars have been scrolled.
scrollpos = "0 0"; scrolls to the top-left; the first value is the horizontal bar, the second value is the vertical bar.

PHP Code:
tile true
Okay, this is part of the Scroll's profile. The profile is what the scroll looks like, such as the image, whether or not it's tiled, the color it's tinted, ect.
To modify this, you can create a new profile for any NPC to use by doing
PHP Code:
new GuiControlProfile(Name) {
  
bitmap "defaultscroll.png";
  
tile true;
  
transparency 1;
  
blue 1;
  
red 0;
  
green 0;

With this, you can use 'profile = "Name"' in all your scroll controls to give them the same properties.

Alternatively, you can use 'useownprofile = true;'
This allows you to modify the profile of just that one Gui Control.
PHP Code:
useownprofile true;
profile.tile true;
profile.blue 1;
profile.green 1;
profile.red 1
The only thing is that some of the default attributes of the scroll, such as the image, are wiped. You'll have to use 'profile.image = "defaultscroll.png"'


Good luck, I've tried playing with scroll profiles, but I found them confusing.. I think they need more support, such as the ability to use an image for the border.. Unless they already have it.

Last edited by Yen; 12-07-2005 at 02:11 AM..
Reply With Quote
  #4  
Old 12-07-2005, 06:48 AM
prozac424242 prozac424242 is offline
Registered User
prozac424242's Avatar
Join Date: May 2001
Location: Gone crazy: back soon
Posts: 356
prozac424242 is on a distinguished road
Send a message via ICQ to prozac424242 Send a message via AIM to prozac424242
Thank you Yen for this very helpful information.

What was your resoruce for all that knowledge?
Becasue I was unable to find that level of description of what the paramaters are on the wiki. Please hook me up with the resource you used to learn that.
__________________

Useful links:
Graal Stats
Client Script Functions-GS1 to GS2
Serverside Script Functions-Gscript page
Particle Engine-Player Attributes
Server Options-Admin rights-Gmaps
Quote:
Originally Posted by Admins
Thanks for developing and improving playerworlds and such
Reply With Quote
  #5  
Old 12-07-2005, 07:19 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 prozac424242
What was your resoruce for all that knowledge?
Becasue I was unable to find that level of description of what the paramaters are on the wiki. Please hook me up with the resource you used to learn that.
I only know such things from looking at the code Stefan released (RC weapons, Level editor, etc).

HTML Code:
vscrollbar = "hi there";
One of my favorite lines of code.
__________________
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
  #6  
Old 12-07-2005, 04:20 PM
ApothiX ApothiX is offline
Okiesmokie
Join Date: May 2004
Posts: 1,447
ApothiX is on a distinguished road
Quote:
Originally Posted by napo_p2p
I only know such things from looking at the code Stefan released (RC weapons, Level editor, etc).

HTML Code:
vscrollbar = "hi there";
One of my favorite lines of code.
I agree.

And regarding the profiles, you should use GuiScrollCtrlProfile, not GuiControlProfile.
__________________


[06:24:19] * Parts: Skyld (i=silent@unaffiliated/skyld) ("Perhaps Okiesmokie did not realise that I like the boys. ")
Reply With Quote
  #7  
Old 12-10-2005, 12:17 AM
Yen Yen is offline
Banned
Yen's Avatar
Join Date: Oct 2005
Location: Nova Scotia, Canada
Posts: 1,085
Yen is an unknown quantity at this point
Send a message via AIM to Yen Send a message via MSN to Yen
I learned by trial and error.
And common sense.
And looking at the RC.
But mostly trial and error.
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 12:49 PM.


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