Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   Just wondering. (https://forums.graalonline.com/forums/showthread.php?t=46700)

osrs 08-01-2003 10:46 PM

Just wondering.
 
Take a look at this code:

NPC Code:

//#CLIENTSIDE

if (created || timeout) {
this.h=textheight(.6,Courier New,b);
showtext 200,screenwidth-100,screenheight-this.h,Courier New,b,X:#v(playerx) Y: #v(playery);
changeimgcolors 200,1,1,1,1;
changeimgzoom 200,.6;
changeimgvis 200,4;
message #v(this.h);
timeout = .05;
}



I was testing textheight() yesterday,i understand how it work etc,but i can't figure out how the value is set,i mean,this.h returns 14,so what i want to know is how the calcule was made.

Quote:

textheight(zoom,font,style) calculates
the height of text displayed with the
given zoom factor, font name and style;
I read that at newfeatures,so,each font name and style has a determined value?

Knuckles 08-01-2003 11:22 PM

pixels? fontsize?

tlf288 08-01-2003 11:34 PM

Did you even ask a question, osrs? You need
more than a question mark to make something
a question. I don't even know what you are
asking :\ .

osrs 08-02-2003 01:29 AM

Quote:

Originally posted by tlf288
Did you even ask a question, osrs? You need
more than a question mark to make something
a question. I don't even know what you are
asking :\ .

NPC Code:

this.h=textheight(.6,Courier New,b);



Explain me why that variable is equal to 14. :rolleyes:
That's what i wanna know,i didn't get how the calculation is done..

Thought 08-02-2003 01:36 AM

It probably checks all characters available to the font and takes the largest height.

Projectshifter 08-02-2003 08:07 AM

Yes, it would do the largest height. But it just checks what it's written/drawn and sees how tall it is... it's not all that hard =x
Think about it, triggeraction works, but you don't know HOW other than that Stefan coded it in... does it really matter HOW opposed to it's actual use?
---Shifter

Kaimetsu 08-02-2003 09:19 AM

Quote:

Originally posted by Projectshifter
it just checks what it's written/drawn and sees how tall it is...
That's very unlikely.

Projectshifter 08-02-2003 11:12 PM

Nah, it's possible, depending no HOW you go about showing things... I dunno about Delphi... but it could set vars and draw the image the size of the vars... does it really matter HOW or WHY it works though as long as we both know it works?
---Shifter

Kaimetsu 08-03-2003 01:40 AM

Quote:

Originally posted by Projectshifter
Nah, it's possible, depending no HOW you go about showing things... I dunno about Delphi... but it could set vars and draw the image the size of the vars...
You said that it would draw the text and then see how big the rendered text is. That would be stupid. It's more likely that the height of the font's surface is modified by zoom parameters etc and outputted directly.

Quote:

does it really matter HOW or WHY it works though as long as we both know it works?
Obviously it matters to the creator of the thread. Are you entitled to tell him not to care?

Projectshifter 08-04-2003 12:46 AM

Quote:

Originally posted by Kaimetsu
Obviously it matters to the creator of the thread. Are you entitled to tell him not to care?
HONESTLY, why does everything lately have to be so hostile with you? to find out, you'd have to ask Stefan, but I'm merely stating that it doesn't change anything. That's like asking some random person "Do you live in an urban area or suburban area?" If you never go to that persons house, does it matter all that much? It doesn't change anything in your universe =x
---Shifter

osrs 08-04-2003 02:01 AM

hey guys,no need to fight. :)

voicedcow6666 08-04-2003 02:07 AM

Quote:

Originally posted by osrs
hey guys,no need to fight. :)
I don't think they were fighting as much as Kaim was pointing out the flaws in PS's thinking, which is always fun to do. PS thinks he knows a lot more than he really does. *thinks back to PS and mine's "debate" about coding standards earlier*

Kaimetsu 08-04-2003 04:56 AM

Quote:

Originally posted by Projectshifter
HONESTLY, why does everything lately have to be so hostile with you? to find out, you'd have to ask Stefan, but I'm merely stating that it doesn't change anything.
So what? So he's not allowed to ask? Sometimes people want to know things just out of curiosity.

Projectshifter 08-04-2003 09:07 PM

Quote:

Originally posted by voicedcow6666


I don't think they were fighting as much as Kaim was pointing out the flaws in PS's thinking, which is always fun to do. PS thinks he knows a lot more than he really does. *thinks back to PS and mine's "debate" about coding standards earlier*

Thanks Zega, glad to know my old friends are always on me side...
---Shifter

voicedcow6666 08-04-2003 09:36 PM

Quote:

Originally posted by Projectshifter


Thanks Zega, glad to know my old friends are always on me side...
---Shifter

Heh, sorry that I agree with Kaim over you....I'm also sorry you were acting like a nut in Delt's RC yesterday....I'm also sorry you blocked me on aim because I proved you wrong about coding standards.


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

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