Author Topic: Label wrap problem  (Read 516 times)

bloomk

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 38
    • View Profile
Label wrap problem
« on: May 18, 2017, 04:53:40 PM »
In a recent version this started happening

It creates a new line when it should not..

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 300
  • -Receive: 1136
  • Posts: 21,947
  • Toronto, Canada
    • View Profile
Re: Label wrap problem
« Reply #1 on: May 19, 2017, 05:17:24 AM »
Can you submit a simple repro project showing the issue so I can have a look? I don't see this problem on my end.

bloomk

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 38
    • View Profile
Re: Label wrap problem
« Reply #2 on: May 19, 2017, 12:59:09 PM »
I PM'd youth repo project..

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 300
  • -Receive: 1136
  • Posts: 21,947
  • Toronto, Canada
    • View Profile
Re: Label wrap problem
« Reply #3 on: May 25, 2017, 06:06:08 AM »
Thanks! I imported your project, saw the issue then imported the latest NGUI and the issue was gone. So if the current Asset Store version still has the issue then it will be fixed in the next update.

bloomk

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 38
    • View Profile
Re: Label wrap problem
« Reply #4 on: May 25, 2017, 01:23:03 PM »
When is the next update? What version has the fix?

bloomk

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 38
    • View Profile
Re: Label wrap problem
« Reply #5 on: May 26, 2017, 11:59:24 AM »
?

Shifty Geezer

  • Full Member
  • ***
  • Thank You
  • -Given: 7
  • -Receive: 7
  • Posts: 216
    • View Profile
Re: Label wrap problem
« Reply #6 on: May 28, 2017, 05:20:00 AM »
I am experiencing this problem. It happens with a text file obtained from an Amazon S3 storage bucket, where I'm placing my latest news. The same text loaded locally has no problems. If printed to console there are no line breaks. I've updated to the latest NGUI (3.11.3, downloaded today from direct link, not Asset Store).

Shifty Geezer

  • Full Member
  • ***
  • Thank You
  • -Given: 7
  • -Receive: 7
  • Posts: 216
    • View Profile
Re: Label wrap problem
« Reply #7 on: May 28, 2017, 06:08:10 AM »
I've compared the source text (908 bytes), the downloaded text file from S3 (907 bytes), and saved the downloaded file to a text file (907 bytes) and they are identical.

Here's my code. The text is broken with or without typewriter effect being used.

  1.      private IEnumerator GetWWWNews() {
  2.                 if(!typewriter.enabled){
  3.                 yield return new WaitForSeconds(2);
  4.                         WWW w = new WWW("https://s3.eu-west-2.amazonaws.com/com.softwaregeezers.novawars/news.txt");
  5.                  yield return w;
  6.                  if (w.error != null){
  7.                                 Debug.Log("Error .. " +w.error);
  8.                                 typewriter.enabled = true;
  9.                                 newsLabel.text = offlineNews.text;
  10.                                 typewriter.ResetToBeginning();
  11.                                 scrollNews.ResetPosition();
  12.                  }else{
  13.                                 typewriter.enabled = true;
  14.                                 if(DEV_useOfflineNews){
  15.                                         newsLabel.text = offlineNews.text;
  16.                                 }else{
  17.                                         newsLabel.text = w.text;
  18.                                         print(w.text);
  19.                                         System.IO.File.WriteAllText("D:/_temp/newsOutput.txt", w.text);
  20.                                 }
  21.                                 typewriter.ResetToBeginning();
  22.                                 scrollNews.ResetPosition();
  23.                         }
  24.                 }
  25.         }
  26.  

Shifty Geezer

  • Full Member
  • ***
  • Thank You
  • -Given: 7
  • -Receive: 7
  • Posts: 216
    • View Profile
Re: Label wrap problem
« Reply #8 on: May 28, 2017, 06:23:28 AM »
Repro case -
create a new NGUI project
add a UILabel
add a script that updates the label text using the above Unity WWW method
load in my text file from "https://s3.eu-west-2.amazonaws.com/com.softwaregeezers.novawars/news.txt"

bloomk

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 38
    • View Profile
Re: Label wrap problem
« Reply #9 on: May 30, 2017, 03:04:30 PM »
Can you please tell me when the update to fix this will be out... it has caused major issues in my game and we are all literally waiting for this update to fix these issues..

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 300
  • -Receive: 1136
  • Posts: 21,947
  • Toronto, Canada
    • View Profile
Re: Label wrap problem
« Reply #10 on: June 05, 2017, 03:47:58 AM »
In the future, just reach out via email and request a zip of the latest NGUI version. It would only take me a minute, and you will have a fix right away. I was super busy over the past month -- and the last week even more so with the release of a public play test of my game, so an NGUI update on the Asset Store had to be delayed. Replying to a request for a ZIP though -- that would have been quick. I'll go ahead and put the NGUI update now.

Shifty Geezer

  • Full Member
  • ***
  • Thank You
  • -Given: 7
  • -Receive: 7
  • Posts: 216
    • View Profile
Re: Label wrap problem
« Reply #11 on: June 08, 2017, 04:32:51 PM »
My problem is not fixed in the new version. A text document from the web gets chopped up in the wrong places as described above.

Shifty Geezer

  • Full Member
  • ***
  • Thank You
  • -Given: 7
  • -Receive: 7
  • Posts: 216
    • View Profile
Re: Label wrap problem
« Reply #12 on: June 08, 2017, 04:48:55 PM »
If I strip out newlines and line-feeds (ignore characters with ASCII below 14), the wordwrapping works, but there are no paragraphs of course. Including either ASCII 10 or 13 breaks the word wrapping the same way.

Shifty Geezer

  • Full Member
  • ***
  • Thank You
  • -Given: 7
  • -Receive: 7
  • Posts: 216
    • View Profile
Re: Label wrap problem
« Reply #13 on: June 09, 2017, 04:23:30 AM »
My current hack is to save the imported file to a local file, then load that file in and display the string. This works in the editor but not on devices.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 300
  • -Receive: 1136
  • Posts: 21,947
  • Toronto, Canada
    • View Profile
Re: Label wrap problem
« Reply #14 on: June 10, 2017, 06:42:02 AM »
I need a repro case, because everything works correctly on my end from both example projects I've received. Simply pasting code that references some external classes is not a repro case. :P