Author Topic: Wrong Color in UILabel  (Read 2135 times)

Romulus

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 12
    • View Profile
Wrong Color in UILabel
« on: August 14, 2015, 03:48:57 AM »
Hello, I have a problem with the color in UILabel. Sometimes the color of the text is not correct in the UILabel.
The bug can be repeated in the scene Example 12 - Chat Window.
Enter "[4C4C4C] tests [-]" in the Input. Press Enter.
Enter "[ffffff] This is an example paragraph for the textThis is an example paragraph for the text [-]" in the Input. Press Enter.
Screenshot from the bug below.

Thanks.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Wrong Color in UILabel
« Reply #1 on: August 14, 2015, 09:55:58 AM »
Open NGUIText.cs, line 1101:
  1. if (wrapLineColors) mColors.Add(c);
Change to:
  1.                 if (wrapLineColors)
  2.                 {
  3.                         mColors.Add(c);
  4.                         sb.Append("[");
  5.                         sb.Append(NGUIText.EncodeColor(c));
  6.                         sb.Append("]");
  7.                 }