Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - taorui

Pages: [1]
1
NGUI 3 Support / Re: text line breaks in UILabel in some condition
« on: November 10, 2015, 08:59:12 PM »
Thank you for your reply, I will try it. :)

2
NGUI 3 Support / text line breaks in UILabel in some condition
« on: November 06, 2015, 08:57:57 AM »
hi, I ran into an issue that text line breaks when ascii characters and some other languages like Japanese mixed together.

Like the pictures attached below, in the first line in UILabel, there is only a space placed between the "(1)" and Japanese characters,
but the line breaks and looks like the Japanese characters start from the second line.
(UILabel is set to resize-height)

This only happens in the first line, as you can see, the "(2)" and the following characters are displayed correctly.

Is there any way to avoid this? If any, please let me know, thanks!

3
NGUI 3 Support / Re: UILabel disappears (Dynamic font, OnFontChanged)
« on: October 02, 2015, 06:03:42 AM »
I am trying to update my NGUI up to 3.9.3 in Unity 4.6.7f1 and also got a problem on OnFontChanged().
The error occurs at line 985 in UILabel.cs
  1. for (int i = 0, imax = mTempPanelList.Count; i < imax; ++i)
  2. {
  3.      UIPanel p = mTempPanelList[i];
  4.      p.Refresh();
  5. }
  6.  
which told me that the index i is invalid and Unity throws out an ArgumentOutOfRangeException.
It seems that the mTempPanelList has been changed during the for loop performing.

When I found this post I tried to replace OnFontChanged as same as dafunker posted above, then everything seems work well.
I am not clearly know why it happens but thanks to dafunker for his/her effort.
Looking forward a better solution come out.

4
NGUI 3 Support / Re: UILabel "vibrates" all the time
« on: July 26, 2015, 08:48:32 PM »
Thank you very much for the reply, I will review the pivots. ;)

5
NGUI 3 Support / UILabel "vibrates" all the time
« on: July 23, 2015, 04:06:40 AM »
Hi,
I recently updated NGUI from 3.7.9 to 3.9.0b on Unity4.6.7f1 and I found some UILabels in my project became "vibrating", which means their widths (or maybe locations) change all the time and never stop.
All these "vibrating" labels are using dynamic font, set as ResizeFreely, and using Advanced anchor like only set Left anchor to its neighbor.

You can see this in following steps in a new project:
1. create an UIWidget container and add an UISprite as a child, set its anchors as Unified to the container.
2. create an UILabel (say label1), use font: "Fantasy Font - Normal" in NGUI example, input some text, set it ResizeFreely, and only set its left anchor to UISprite's right side. Anchor executes "OnUpdate".
3. create another UILabel(say label2), do same thing to label2 and set its left anchor to label1's right side.
4. run game and you may see label1 and/or label2 are "vibrating". If not, try to modify label1's left anchor's distance to UISprite.
5. it's easier to happen if sets text every frame in Update().

I'm not sure what causes this but when I tried to check the diff between these two versions, I found that two lines are added in UIWidget.cs (line 1213~1214 in OnAnchor()), which rounds up newPos.x and newPos.y. And if I commented them out, then "vibrating" disappears and UILabel works as usual.

I would like to ask how to solve this problem, or just I shouldn't use UILabel in such a way?
Thank you.

Pages: [1]