Tasharen Entertainment Forum

Support => NGUI 3 Support => Topic started by: ThomasIndustry on April 16, 2015, 11:01:46 AM

Title: Text appearing outside of UILabel bounds
Post by: ThomasIndustry on April 16, 2015, 11:01:46 AM
I am creating a series of UIlabels dynamically using the NGUITools.AddChild<UILabel>(this.gameObject) function, but sometimes (Randomly about 20% of the time) the text shows up outside of the bounds area. If I manually disable the game object and then turn them back on, it corrects it's self, but this is not a very eloquent solution. Does anyone have an idea of what might be causing this?
They are under a panel with soft clipping and have their pivot set to left.

(http://i.imgur.com/dbxmVwt.png)
Title: Re: Text appearing outside of UILabel bounds
Post by: Dean on April 16, 2015, 01:04:41 PM
Try using NGUITools.MarkParentAsChanged(gameObject); after all changes
Title: Re: Text appearing outside of UILabel bounds
Post by: ThomasIndustry on April 16, 2015, 03:20:33 PM
I have tried that  :-\ and also tried levelName.MarkAsChanged() and levelName.SetDirty()
Title: Re: Text appearing outside of UILabel bounds
Post by: ArenMook on April 18, 2015, 12:42:07 PM
Make sure to set the text last, after the position/width/height have been set, but that's all I can suggest without having more details.