Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Dark GDK / Weird text in my string

Author
Message
Phosphoer
16
Years of Service
User Offline
Joined: 8th Dec 2007
Location: Seattle
Posted: 28th Jun 2009 10:51 Edited at: 28th Jun 2009 11:07


I'm using this function to draw wrapped text to the screen:


And this is the code I'm using to call it:


Why does this happen? The problem doesn't occur if I remove the " || Text[CurrentChar] != ' ' " But I need that to make the lines break only on spaces. ><

Mireben
16
Years of Service
User Offline
Joined: 5th Aug 2008
Location:
Posted: 28th Jun 2009 14:07
I guess it is because your Line character array does not have a null terminator, so dbText does not know where the string ends. Try adding this line just before calling dbText:



If you do this, there should be no need to fill the Line array with spaces as you do in the "for" loop at the end, since characters after the terminator will not be displayed even if some are remaining from the previous line.
Phosphoer
16
Years of Service
User Offline
Joined: 8th Dec 2007
Location: Seattle
Posted: 29th Jun 2009 01:58
Ah! That fixed it! Thanks much

Login to post a reply

Server time is: 2024-10-01 05:50:59
Your offset time is: 2024-10-01 05:50:59