Tasharen Entertainment Forum
Support => NGUI 3 Support => Topic started 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)
-
Try using NGUITools.MarkParentAsChanged(gameObject); after all changes
-
I have tried that :-\ and also tried levelName.MarkAsChanged() and levelName.SetDirty()
-
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.