Function: WrapText
Displaying 1-3 of 3 total.
1
Please enter a numerical value for the importance of this sticky.
Enter 0 to unsticky.
resident

How is this used?

PrintString doesn't seem to care about newlines, and there's no indication in the example usage as to how I might go about making use of the newlines that wraptext has inserted. Presumably I could parse through the string looking for them and use left() and right() to get individual lines of text , but what precisely denotes a newline?

Posted on 2008-06-07 11:23:40 (last edited on 2009-03-29 01:01:23)

Overkill

Yeah hm, I agree that the example needs to be revised! For one, remember that WrapText has a return value! You don't just pass it the string, you need to capture the result, since Verge doesn't HAVE reference types. The returned string has these newlines. And actually, PrintString *does* care about newlines, and has for several releases now. And chr('\n') (or chr(10)) denotes that newline character. Try it! Note that Verge doesn't have escape characters in its strings, but does for character constants, sooo, you kind of need to use chr() to add in newlines! Sucks, but I think that we'd break a lot of old code if we suddenly made \ an escape character for regular strings. Oh, and I wouldn't have bothered adding a WrapText if I thought PrintString couldn't automatically handle it! So yeah.

Posted on 2008-06-07 12:49:38

resident

Well, that's curious. I have indeed tried it, otherwise I wouldn't have made the statement. The string is output correctly in the log with newlines, but PrintString itself didn't seem to care.
Possibly I'm using the wrong version of VERGE or something. I'll have to check. edit: (date reported is 2007.07.08 20070708 win)
OK, I'm mistaken: the string is logged the same both before and after wraptext.
Ah, gottit. The new documentation has been exceptionally handy. i wasn't catching the return variable.
Man, that function simplfies textbox code to a ridiculous degree. I salute you.

As for the printstring prob... maybe a function variant, like PrintStringEX (see LoadFontEx) that supports escape characters? That way you're not breaking old code?

Posted on 2008-06-07 13:07:39 (last edited on 2008-06-07 13:49:36)


Displaying 1-3 of 3 total.
1
 
Newest messages

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.