![]() |
Text Length
Some Function is needed to calculate the length (in pixles) of a string at a certain size and font .. like
textlen(string,zoomfactor,font) Seeing as how fonts are not fixed width. It would be nice for some things I have been making. |
good idea, horrible naming convention
textlen reminds me of the length of a string. maybe textwidth? |
Re: Text Length
Quote:
I know what you mean. :-( Was a guessing game getting text to match up to stuff. |
Isn't there a command to get the image width and height? If that's set up to work with @ images...
|
nope, just to get the width of an image in memory.
Also. IMPLEMENT THIS IDEA NOW!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!! |
Quote:
|
Re: Text Length
Quote:
I don't know why, but I am set on the idea that you don't want text to go off screen.. and I want to tell you to use the wraptext command :( |
Re: Re: Text Length
Quote:
|
Quote:
|
** HAPPY MEDIUM TIME :D **
this.textwidth = 8*int(strlen(#s(this.text))); works fine for me... |
...on fixedwidth fonts
|
Quote:
|
this.textwidth = 8*int(strlen(#s(this.text)))*imgzoom;
ha! and if you dont use fixedwidth fonts.... i hate you :P *edit* FIXEDSYS PWNS YOU ALL!!! |
Quote:
My advice to you: Don't talk. (or post) |
Its probably better or maybe best to use FixedSys for easy reading. Everyone has it. I try to stay away from really fancy fonts as far as game text goes. You want the player to be able to read the text, right?
|
I too like fixed-width fonts. If you don't, though, you could probably do some crazy thing with wraptext2 and tokenscount checking to find the length. Completely inefficient, but you might have no choice.
|
Quote:
|
maybe you could just manually count the pixels in every letter of the font you want to use
|
Re: Re: Text Length
Quote:
|
Quote:
|
Quote:
Please take my prior advice and just stop posting. |
Quote:
|
Re: Re: Re: Text Length
Quote:
|
| All times are GMT +2. The time now is 04:27 PM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.