Original Post
I''m currently working on a remake of the classic NES Dragon Warrior. I''m in process of adding Text Message where all the conversations happen. But I''m stumped by this stupid little problem called Word Wrap. I''m making my own Font engine. Anyway, here''s the code that I have for word wrap:
for(int j = 0+(currentLine*68); j <= 68+(currentLine*68); j++)
{
if(Msg[j] == '' '')
{
tracker = j;
}
}
Each line is 69 letters long, and this is how it works:
It takes the last space in the line and ends there, and starts another line. The problem is that the word wrap works perfectly in the first line, but fails miserably after that. For example
This is a testing. |
This word shouldn''t|
be wrapped. |
actually is
This is a testing. |
This wor |
d shouldn''t |
be wrapped. |
or something like that. I don''t know what''s wrong with it.
To debug...
Or not to debug...
That is the question.