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 01-07-2007, 10:08 PM
cbk1994 cbk1994 is offline
the fake one
cbk1994's Avatar
Join Date: Mar 2003
Location: San Francisco
Posts: 10,718
cbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond repute
Send a message via AIM to cbk1994
Chat System Word Wrapping

I recently scripted a new chat system for Syn, and it works fine except for one thing -- how can I get the text to word wrap? Here's an example:

|---text text te| ( text text text is what it needs to show ) ( | is the border )
|--------o-----| ( o is the player )

It centers over the player, but I don't want it to go over where players cannot see it (screenwidth).
Someone said use textwidth, but I couldn't get that to work, it seems like it wasn't translated to GS2 properly.
Is there any way, still using a show text (not a gui) to do this? I don't think I'd be able to do it with a GUI either, so ... yah.

Any help is greatly appreciated.
Thanks,
Chris Zakuto
NAT of Syn
__________________
Reply With Quote
  #2  
Old 01-07-2007, 11:04 PM
Tolnaftate2004 Tolnaftate2004 is offline
penguin.
Join Date: Jul 2004
Location: Berkeley, CA
Posts: 534
Tolnaftate2004 is a jewel in the roughTolnaftate2004 is a jewel in the rough
Send a message via AIM to Tolnaftate2004
gettextwidth() is the GS2 version.
__________________
◕‿‿◕ · pfa · check yer syntax! · src

Killa Be: when i got that locker in 6th grade the only thing in it was a picture of a midget useing a firehose :/
Reply With Quote
  #3  
Old 01-08-2007, 02:26 AM
cbk1994 cbk1994 is offline
the fake one
cbk1994's Avatar
Join Date: Mar 2003
Location: San Francisco
Posts: 10,718
cbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond repute
Send a message via AIM to cbk1994
That really doesn't answer my question. I was using that, but it seems it wasn't moved from GS1 to GS2 right ... for example
PHP Code:
temp.blah "meow";
echo( 
gettextwidth"Arial""b"temp.blah ) ); 
won't work. However
PHP Code:
temp.blah "meow";
echo( 
gettextwidth"Arial""b"meow ) ); 
will, even without quotes around meow ...
__________________

Last edited by cbk1994; 01-08-2007 at 03:23 AM.. Reason: typo
Reply With Quote
  #4  
Old 01-08-2007, 03:53 AM
coreys coreys is offline
N-Pulse Assistant Manager
coreys's Avatar
Join Date: Mar 2005
Posts: 2,180
coreys has a spectacular aura about
Send a message via AIM to coreys Send a message via MSN to coreys Send a message via Yahoo to coreys
You should proubably try checking if the texts x plus its width are greater than screenwidth.
__________________

Quote:
*SlikRick: so should I even ask about your aim status?
*Xor: well if you want to
*Xor: but i am LARPING
*SlikRick: While on a computer?
*Xor: yes
*Xor: in my living room
*SlikRick: ahh
*Xor: i have a fort setup to hide from beasts
Reply With Quote
  #5  
Old 01-08-2007, 04:22 AM
cheatbobb cheatbobb is offline
The_Danish
cheatbobb's Avatar
Join Date: Apr 2004
Location: Canada
Posts: 15
cheatbobb is on a distinguished road
wraptext2(pixel width,zoom,delimiters,text)
This will give you an array of lines separated at the delimiters that fits in the pixel width. It's probably much more useful to you than textwidth in this case.
__________________
Reply With Quote
  #6  
Old 01-08-2007, 04:27 AM
cbk1994 cbk1994 is offline
the fake one
cbk1994's Avatar
Join Date: Mar 2003
Location: San Francisco
Posts: 10,718
cbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond repute
Send a message via AIM to cbk1994
uhh ... I really don't get that. lol
__________________
Reply With Quote
  #7  
Old 01-08-2007, 06:38 AM
Tolnaftate2004 Tolnaftate2004 is offline
penguin.
Join Date: Jul 2004
Location: Berkeley, CA
Posts: 534
Tolnaftate2004 is a jewel in the roughTolnaftate2004 is a jewel in the rough
Send a message via AIM to Tolnaftate2004
That, and gettextwidth takes a fourth parameter.
__________________
◕‿‿◕ · pfa · check yer syntax! · src

Killa Be: when i got that locker in 6th grade the only thing in it was a picture of a midget useing a firehose :/
Reply With Quote
  #8  
Old 01-09-2007, 02:14 AM
cbk1994 cbk1994 is offline
the fake one
cbk1994's Avatar
Join Date: Mar 2003
Location: San Francisco
Posts: 10,718
cbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond repute
Send a message via AIM to cbk1994
I managed to get wraptext2 to work, now I just need to figure out how to use gettextwidth ... anyone care to tell me the paramaters?
__________________
Reply With Quote
  #9  
Old 01-09-2007, 03:56 AM
cheatbobb cheatbobb is offline
The_Danish
cheatbobb's Avatar
Join Date: Apr 2004
Location: Canada
Posts: 15
cheatbobb is on a distinguished road
Returns the width of a specified text in a certain font. Format:
PHP Code:
gettextwidth(zoomfontstyletext
Copied directly from http://wiki.graal.net/index.php/Crea.../Script/Client
__________________
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 03:48 AM.


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