The Daily Click ::. Forums ::. Klik Coding Help ::. Text Blitter and INI Files
 

Post Reply  Post Oekaki 
 

Posted By Message

Cyrillus



Registered
  13/08/2008
Points
  5
6th March, 2011 at 03:40:35 -

I've tried my best to find a solution to this problem on my own, but I haven't had much luck. So, I thought I'd try asking here. I'll try my best to explain what the matter is.

I've been working on a quiz game, not unlike Quiz & Dragons, and I thought having the game read questions from an INI file would work best. I could store the display text for each question/group, along with four possible answers, and indication of which one is correct. Sounds simple enough, right? Well, it was. Everything pretty much works as it should. I have everything set up so that text is loaded from an INI file into the Text Blitter one letter at a time, from left to right, so that the text scrolls onto the screen. This is all well and good, except that when the text reaches the end of a line, the entire word jumps to the next line, like this:

(THIS)
The quick brown fox jum

(TURNS TO THIS)
The quick brown fox
jumps over the lazy dog.

Since each line in the INI file is counted as a separate item, I can't simply press Enter to sort the text into multiple lines. I thought maybe there was a Unicode character that might help, but my knowledge is limited in this area, and I couldn't seem to find anything that would work. As things are now, it just looks awful to see the scrolling text jump around like that. Does anyone know a way around this? Any help would be greatly appreciated.

 
n/a

Zephni

My other cars a Balrog

Registered
  17/10/2007
Points
  4019

Has Donated, Thank You!VIP MemberSonic Speed
6th March, 2011 at 09:55:26 -

Maybe use a character you might not use like ^ or % and when the text gets to that character the text adds a $newline and then gets rid of the ^ or % character.

Edited by Zephni

 
dont make me divide by zero...

Cyrillus



Registered
  13/08/2008
Points
  5
12th March, 2011 at 09:23:38 -

I apologize for the late response. To be honest, I hadn't done any work on the game until just now, and this all slipped my mind completely.

Thanks to your advice, Zephni, I was able to solve my problem. I downloaded the INI Plus Plus object, which supports "Escape Characters", apparently. After a little research, working out the rest was easy. Simply typing \n amidst the string will signify a line break. I had to remove the graphic for the backslash in the Text Blitter's image file, lest I want it to appear at the end of each line momentarily. Still, no big deal. It's not as if I'll need it.

Again, thank you very much for all your help.

 
n/a
   

Post Reply



 



Advertisement

Worth A Click