Support => NGUI 3 Support => Topic started by: bdominguez on September 13, 2013, 04:22:16 AM
Title: Need NGUI 3.0 Label vertical align fix, please
Post by: bdominguez on September 13, 2013, 04:22:16 AM
Hi Aren,
In the release notes there is a: "FIX: Labels will now again align vertically properly."
Do you mean when you use "maxHeight" with a value different that 0? It's actually my problem.
I asign the pivot to be vertically in the center but it's always in top.
Can you tell me what lines I have to change? Or the "UILabel.cs" file.
Thanks!!
Title: Re: Need NGUI 3.0 Label vertical align fix, please
Post by: ArenMook on September 13, 2013, 09:03:27 AM
In 2.7.0 the labels would always align to the top. In 3.0.0 they get centered vertically again, if the pivot is center, and bottom-aligned if the pivot is bottom.
Title: Re: Need NGUI 3.0 Label vertical align fix, please
Post by: N3uRo on September 13, 2013, 11:03:10 AM
In 2.7.0 the labels would always align to the top. In 3.0.0 they get centered vertically again, if the pivot is center, and bottom-aligned if the pivot is bottom.
I don't know when you are going to release 3.0 to the Asset Store so that's why I said if you can share the code to fix that. I don't know If it's only on UILabel or because you change more things we can't use it with 2.7.0.
Thanks!
Title: Re: Need NGUI 3.0 Label vertical align fix, please
Post by: ArenMook on September 13, 2013, 12:25:09 PM
It's not that simple. 3.0's code is vastly different from 2.7's. Here is the (slightly modified) code that fixed it in 3.0:
Getting it to work for 2.7 you'd need to use mMaxWidth and mMaxHeight insidead as I recall, and after this section you have to iterate through all the vertices in the vertex buffer and offset them by the 'offsetY ' value.