You must be logged in to do that.

TextWidth

TextWidth
int TextWidth(int font, string text)

Documentation

Returns the width (in pixels) of the passed string using the passed font. If you pass 0 for the font handle, it will return the width of the text baesd on the builtin font.

Example Usage

int text_w;

text_w = TextWidth(MainFont, "Hello World!");
Talkback

Post a new comment?

Talkback #2 written by Bloody_Spork on 2012-06-20.

I understand that there is a certain syntax for setting the size of a font besides size 12, but wouldn't it be easier to be able to change the 0 to whatever? Here is a little chart that i whipped up.

0 = 12
1 = 13
2 = 14
3 = 15
********
60 = 72

This way we could easily change the font size, take up less memory by removing some snippets, and A LOT less to type. Please post you comments about this theory, if you will.

Talkback #1 written by verge-rpg.com on 2012-06-20.

This is the talkback thread for the documentation page: textwidth

Post a new comment?

Doc Nav

Your docs
View All Docs

If you log in, you can edit the documentation, or create your own documents and tutorials!

Ben McGraw's lovingly crafted this website from scratch for years.
It's a lot prettier this go around because of Jon Wofford.
Verge-rpg.com is a member of the lunarnet irc network, and would like to take this opportunity to remind you that regardless how babies taste, it is wrong to eat them.