Forum

> > CS2D > Scripts > Finding a String Size
Forums overviewCS2D overview Scripts overviewLog in to reply

English Finding a String Size

6 replies
To the start Previous 1 Next To the start

old Finding a String Size

Masea
Super User Off Offline

Quote
Hello,

You know there is a
string.len
which returns how many characters in the string.

I want something similar to that. That will return the size of the string in x position.

Like,
1
2
3
str = "Hey."

print(string.leng(str))
This will show me 4. But the thing is, the dot takes less space than other characters. Just example, let's say "." takes 1 pixel, "H" 4, "e" 3 and "y" 3. But I'll never have an idea what exactly space do they take.

How to get these?
edited 1×, last 10.12.17 05:51:42 pm
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview