Tasharen Entertainment Forum

Support => NGUI 3 Support => Topic started by: shokinhan on August 19, 2013, 08:41:33 AM

Title: why NGUI2.6.4 don't support "\n" again?
Post by: shokinhan on August 19, 2013, 08:41:33 AM
The version before has the "\n" function.
But now it does't support. why?
The change would make a lot of troubles. Because my text already has a lot of "\n" for editing the text!

Title: Re: why NGUI2.6.4 don't support "\n" again?
Post by: ArenMook on August 19, 2013, 08:51:10 AM
What do you mean "again"? It was never re-added. You probably re-added it yourself.

You need to fix your own text to not include two characters for \n. Newline is a single character.
Title: Re: why NGUI2.6.4 don't support "\n" again?
Post by: shokinhan on August 20, 2013, 07:19:30 AM
I do it as so!

I add an line code as "mProcessedText = mText.Replace("\\n", "\n");", is it right?

   void ProcessText ()
   {
      mChanged = true;
      hasChanged = false;
      mLastText = mText;
      mProcessedText = mText.Replace("\\n", "\n");
               ...............................................

         }

Title: Re: why NGUI2.6.4 don't support "\n" again?
Post by: missingno on August 20, 2013, 08:31:55 AM
I do it as so!

I add an line code as "mProcessedText = mText.Replace("\\n", "\n");", is it right?

   void ProcessText ()
   {
      mChanged = true;
      hasChanged = false;
      mLastText = mText;
      mProcessedText = mText.Replace("\\n", "\n");
               ...............................................

         }

Why are you doing this ? I set the UILabel.text property and include \n for a newline and it works just fine using stock 2.6.4
Title: Re: why NGUI2.6.4 don't support "\n" again?
Post by: ArenMook on August 20, 2013, 02:13:09 PM
For some obscure reason he keeps insisting on passing strings that use double characters for a newline instead of a single character. So instead of fixing his text, he prefers to hack the label. *shrug*
Title: Re: why NGUI2.6.4 don't support "\n" again?
Post by: shokinhan on August 21, 2013, 12:08:25 AM
So if I want to mark the newline at file like 1.txt. And the program would read the file.

How to mark an newline in the file?

Title: Re: why NGUI2.6.4 don't support "\n" again?
Post by: ArenMook on August 21, 2013, 09:49:53 AM
When you read your file, do the string.Replace before assigning it to your label.text.