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 02-22-2004, 06:52 AM
XiLe XiLe is offline
Lylic < Me
XiLe's Avatar
Join Date: Dec 2002
Location: My House
Posts: 224
XiLe is on a distinguished road
Send a message via AIM to XiLe Send a message via MSN to XiLe
Auto Resizing Text

There is obviously no way to shrink text automatically (or at least Loriel said)

I came up with this script, but it doesn't seem to want to work. I tried it with for at first, and when it wouldn't work I tried the while, which just happened to refuse. I reconnected a few times, disconnected and /npcstarted up my NPC Server (couldnt do it with cpanel, it wont work) and it still doesnt work.. any ideas?

function showweap() {
wraptext2 97,.5,@Verdana@b,#w;
i=.5;
// for (i=.5; !strequals(#w,#t(0)); i-=.01 {
while (!strequals(#w,#t(0))) {
i-=.1;
wraptext2 97,i,@Verdana@b,#w;
}
showtext 506,3,1,Verdana,b,#t(0);
changeimgvis 506,8;
changeimgzoom 506,i;
// }
timeout=.05;
}
Reply With Quote
  #2  
Old 02-22-2004, 07:35 AM
R0bin R0bin is offline
Banned
R0bin's Avatar
Join Date: Oct 2002
Location: Wales, UK
Posts: 828
R0bin is on a distinguished road
Send a message via AIM to R0bin
Meh, I cannot see what you are trying to do
Reply With Quote
  #3  
Old 02-22-2004, 08:50 AM
XiLe XiLe is offline
Lylic < Me
XiLe's Avatar
Join Date: Dec 2002
Location: My House
Posts: 224
XiLe is on a distinguished road
Send a message via AIM to XiLe Send a message via MSN to XiLe
I got it working... I was attempting to make the text fit into a small box. For example, on kingdoms when your experience goes from 5 digits to 6, the text shrinks to fit it. It turns out that my NPC-Server is fussy and I had to take out the comments for some reason, then it worked...
Reply With Quote
  #4  
Old 02-22-2004, 01:14 PM
R0bin R0bin is offline
Banned
R0bin's Avatar
Join Date: Oct 2002
Location: Wales, UK
Posts: 828
R0bin is on a distinguished road
Send a message via AIM to R0bin
how strange o.O
Reply With Quote
  #5  
Old 02-22-2004, 05:50 PM
VeX_RaT_Boy VeX_RaT_Boy is offline
WannaBe Scripter
VeX_RaT_Boy's Avatar
Join Date: Aug 2002
Location: Norway
Posts: 960
VeX_RaT_Boy is on a distinguished road
Send a message via ICQ to VeX_RaT_Boy Send a message via AIM to VeX_RaT_Boy Send a message via Yahoo to VeX_RaT_Boy
Quote:
Originally posted by XiLe
I got it working... I was attempting to make the text fit into a small box. For example, on kingdoms when your experience goes from 5 digits to 6, the text shrinks to fit it. It turns out that my NPC-Server is fussy and I had to take out the comments for some reason, then it worked...
NPC Code:
if (strlen(#s(some.string))>5) changeimgzoom index,0.6;


???
__________________
-Kjetil Valen
Reply With Quote
  #6  
Old 02-22-2004, 11:24 PM
XiLe XiLe is offline
Lylic < Me
XiLe's Avatar
Join Date: Dec 2002
Location: My House
Posts: 224
XiLe is on a distinguished road
Send a message via AIM to XiLe Send a message via MSN to XiLe
Quote:
Originally posted by VeX_RaT_Boy

NPC Code:
if (strlen(#s(some.string))>5) changeimgzoom index,0.6;


???
I wanted to go a bit more in depth than that lol. Some characters as you probably know take more width than others... example are "Z" compared to "|" I made it so that it goes through various zooms starting at .5 and going down until it just fits the stuff on the screen.
__________________
AIM: xilesaim MSN: [email protected]
I'm the Co-Owner of Atrius... If you've got questions, ask me
Reply With Quote
  #7  
Old 02-22-2004, 11:43 PM
VeX_RaT_Boy VeX_RaT_Boy is offline
WannaBe Scripter
VeX_RaT_Boy's Avatar
Join Date: Aug 2002
Location: Norway
Posts: 960
VeX_RaT_Boy is on a distinguished road
Send a message via ICQ to VeX_RaT_Boy Send a message via AIM to VeX_RaT_Boy Send a message via Yahoo to VeX_RaT_Boy
Quote:
Originally posted by XiLe


I wanted to go a bit more in depth than that lol. Some characters as you probably know take more width than others... example are "Z" compared to "|" I made it so that it goes through various zooms starting at .5 and going down until it just fits the stuff on the screen.
If I'm not completly wrong, you can use textheight() to calculate that?
__________________
-Kjetil Valen
Reply With Quote
  #8  
Old 02-24-2004, 12:40 AM
Duwul Duwul is offline
Registered User
Join Date: Nov 2003
Posts: 105
Duwul is on a distinguished road
I believe you're thinking of textwidth().

BTW I suggested that and textheight to Stefan. I'm so flattered.
__________________
-Ajira
Liek, omigosh.
<3 DoomsDay.
Reply With Quote
  #9  
Old 02-24-2004, 12:42 AM
-Ramirez- -Ramirez- is offline
Registered User
Join Date: Jun 2002
Location: USA, Ohio
Posts: 729
-Ramirez- has a spectacular aura about-Ramirez- has a spectacular aura about
Quote:
Originally posted by Duwul
BTW I suggested that and textheight to Stefan. I'm so flattered.
You and 23094820394 other people.
__________________
Kat
Reply With Quote
  #10  
Old 02-24-2004, 01:27 AM
Duwul Duwul is offline
Registered User
Join Date: Nov 2003
Posts: 105
Duwul is on a distinguished road
Doubt it.
__________________
-Ajira
Liek, omigosh.
<3 DoomsDay.
Reply With Quote
  #11  
Old 02-24-2004, 02:05 AM
Goboom Goboom is offline
Pixel Monkey
Goboom's Avatar
Join Date: Dec 2001
Location: Michigan
Posts: 1,702
Goboom is on a distinguished road
Send a message via ICQ to Goboom Send a message via AIM to Goboom Send a message via MSN to Goboom Send a message via Yahoo to Goboom
Quote:
Originally posted by Duwul
Doubt it.
I know I sugested it, that makes 2.
__________________
Reply With Quote
  #12  
Old 02-24-2004, 02:12 AM
-Ramirez- -Ramirez- is offline
Registered User
Join Date: Jun 2002
Location: USA, Ohio
Posts: 729
-Ramirez- has a spectacular aura about-Ramirez- has a spectacular aura about
As well as me, there's 3. Anyone else want to prove him wrong?
__________________
Kat
Reply With Quote
  #13  
Old 02-24-2004, 02:17 AM
Duwul Duwul is offline
Registered User
Join Date: Nov 2003
Posts: 105
Duwul is on a distinguished road
Oh well. XP
__________________
-Ajira
Liek, omigosh.
<3 DoomsDay.
Reply With Quote
  #14  
Old 02-24-2004, 10:02 PM
VeX_RaT_Boy VeX_RaT_Boy is offline
WannaBe Scripter
VeX_RaT_Boy's Avatar
Join Date: Aug 2002
Location: Norway
Posts: 960
VeX_RaT_Boy is on a distinguished road
Send a message via ICQ to VeX_RaT_Boy Send a message via AIM to VeX_RaT_Boy Send a message via Yahoo to VeX_RaT_Boy
From newfeatures:
Quote:
- new scripting function:
textheight(zoom,font,style) calculates
the height of text displayed with the
given zoom factor, font name and style;
textheight(1,,) gives the height of
the standard font used for showimg/showtext;
the style is a string with the letters
b (bold), or i (italic), the other styles
don't really make sense - the font name
and font style are generaly not influencing
the height a lot
???
__________________
-Kjetil Valen
Reply With Quote
  #15  
Old 02-24-2004, 10:18 PM
xManiamaNx xManiamaNx is offline
Supreme Dictator
xManiamaNx's Avatar
Join Date: Nov 2002
Location: 127.0.0.1
Posts: 385
xManiamaNx is on a distinguished road
Send a message via MSN to xManiamaNx Send a message via Yahoo to xManiamaNx
textheight calculates the HEIGHT of the text. XiLe is trying to calulate the WIDTH of the text.


<3 big text
__________________
Maniaman

Play Maloria Now: [2.3] [3]
Maloria Website

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 10:35 AM.


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