Hi, I'm trying to draw some content that is multiple lines but have been having problems. For one, immediately after I sync the game to my zod, I run it (naturally). But the first time I run it, there are sometimes trailing chars at the end of the line. Like when I say "NOTHING" sometimes the "N" is at the end of one line whle NOTHING is at the beginning of another. This is fixed if I go to the launcher and launch it again :blink: Also, the last "?" is getting cut off and sometimes (yes, sometimes) the " it".
I know there are some flaws but this is the first time I made this kind of code. Whats wrong?
Here is the part of code I use to draw the text:
I know there are some flaws but this is the first time I made this kind of code. Whats wrong?
Here is the part of code I use to draw the text:
- Code:
char LevelSynop[1][300] =
{
"So I'm just going to ramble on here about NOTHING. Isnt this game awesome? Yes. This game is also going to be awesome. This game will r0x0rz your b0x0rs. LOL! L-O-L = Laugh out Loud. Strange how teenagers can make up some strange things isnt it?"
};
...
Int32 width, slength, length, dLength;
UInt32 pointerPos, y, curPos;
Char *nString = NULL;
...
y = 25;
length = StrLen(LevelSynop[0]);
slength = length;
width = 480 - (20 * 2);
FontGetCharsInWidth(fontIDs[0], LevelSynop[0], &length;, &width;, NULL);
do
{
nString = (Char *)MemPtrNew(length + 1);
StrNCopy(nString, &LevelSynop;[0][pointerPos], length);
dLength = StrLen(nString);
if (nString[length] != ' ' && nString[length] != '.' && nString[length] != '?' && nString[length] != '!')
{
curPos = length;
do
{
curPos -= 1;
pointerPos -= 1;
slength += 1;
dLength -= 1;
} while (nString[curPos] != ' ' && nString[curPos] != '.' && nString[curPos] != '?' && nString[curPos] != '!');
pointerPos += 1;
slength -= 1;
dLength += 1;
}
FontDrawChars(fontIDs[0], nString, dLength, 20, y);
MemPtrFree(nString);
slength -= length;
y += 15;
pointerPos += length;
} while (slength > 0);
...