Author Topic: Printing long text to screen  (Read 1993 times)

leifab

  • Guest
Printing long text to screen
« on: April 17, 2012, 08:31:45 am »
Hi!

Someone who can give my any hint how to write a long text from char array into the screen in multiple lines using TextAdd?

/Leif-Arne

budershank

  • Guest
Re: Printing long text to screen
« Reply #1 on: April 17, 2012, 09:00:20 am »
Depending on your needs, you can use the NoteAdd that was introduced in 2.0  It handles word wrapping for you.  Unfortunately it doesn't support fonts really.

Using the TextAdd you will want to insert a \n inside your array where you want the lines to break.  If you are doing this just for word wrapping purposes then you can iterate through the array and insert the \n at the desired length. 

korn3l

  • Guest
Re: Printing long text to screen
« Reply #2 on: April 17, 2012, 09:57:43 am »
I use a Symbol where i want to make a line break and print it like this:

Code: [Select]
int mytext[10];
int i=0;
char * pch;
pch = strtok ("your text;goes;here",";");
 
  while (pch != NULL)
  {
mytext[i]=TextAdd(posx,posy,pch,font);
pch = strtok (NULL, ";");
i++;
        posy+=20;
}
I use this mehtod also for NetSend Responses and it works very good :)

~Kornel