Multiline text problem

Game Editor comments and discussion.

Multiline text problem

Postby Leif » Wed Sep 22, 2010 10:20 am

Hi :)

The problem is:

- Ihave text file with text strings like : ---------=---------=---------=---------\n=---------=---------=---------=-------\n--=---------=---------=
- I load this strings into global string array
- when i do

Code: Select all
strcpy(actor.text, array[0]);


it displays text in ONE line (instead of three desired )

What's wrong ? :?:
Repulsor beam + heavy cannons
User avatar
Leif
 
Posts: 147
Joined: Mon Dec 15, 2008 12:42 pm
Location: Moscow, Russia
Score: 10 Give a positive score

Re: Multiline text problem

Postby DilloDude » Wed Sep 22, 2010 11:56 am

\n is the script editor code for a newline character. Entering it into your text file will literally store the characters \n, and when you load it, you load those characters.
To load them as newline characters, you must put them in the text file as actual new lines.
Image
User avatar
DilloDude
 
Posts: 866
Joined: Tue Jan 24, 2006 9:51 am
Location: Nyerellion
Score: 58 Give a positive score

Re: Multiline text problem

Postby Leif » Wed Sep 22, 2010 1:21 pm

Is there any way to divide one string into several lines at runtime ?
Repulsor beam + heavy cannons
User avatar
Leif
 
Posts: 147
Joined: Mon Dec 15, 2008 12:42 pm
Location: Moscow, Russia
Score: 10 Give a positive score


Return to GE - General

Who is online

Users browsing this forum: No registered users and 1 guest

cron