Page 1 of 1

\B.... but custom?

Posted: Thu May 04, 2006 12:52 am
by Ice Cream Jonsey
You know how \B .. \b denotes bold text in Hugo? And \I (text) \i does the same for italics? Can you make your own version of that?

Let's say you want \Y \y to note that the text in between should be yellow. Can you do that by making a change to the library?

Posted: Thu May 04, 2006 5:03 am
by Merk
I never found a way, when I was messing with colors before. A section starting at around line 240 in hemisc.c (the Hugo source code) shows where it handles format codes.

It would probably be possible to write your own front-end, but I don't know how slow it would be. Basically, you'd call a functon like MyPrint("whatever"), which converts "whatever" to an array and then processes it a character at a time. You could look for your own formatting codes there, and just "print" (with a semicolon after each character) anything that isn't your own code. It probably wouldn't even be a very difficult routine to write.

Posted: Fri May 05, 2006 7:17 pm
by Guest
You could also write a little pair of routines like

StartMyText
"Blah Blah Blah..."
EndMyText

where StartMyText would 'text to <somearray>' and EndMyText would purge the <somearray> buffer, paying attention to your custom formatting, before setting 'text to 0', in order to save on filling up the dictionary with those phrases passed as arguments. If that makes any sense.

Posted: Sun May 07, 2006 10:32 pm
by Ice Cream Jonsey
Thanks, guys. Yeah, I ended up just with making a routine that lets me throw the text I want to be colored cyan as the routine's argument. Simple enough for what I'm trying to do, I think.

Robb

Posted: Mon May 08, 2006 7:44 pm
by Guest
Actually, for what it's worth, if you check out the FB source code, the dialogue coloring is handled sort of like I described.

Posted: Mon May 08, 2006 8:18 pm
by Ice Cream Jonsey
Oh! Well, then. Yes. I'm not married to breaking up lines of speech with the semicolon and a function call. I'm not married to that idea at all. I'm down at the bar on my fifth vodka gimlet just looking for an excuse.