Tasharen Entertainment Forum

Support => NGUI 3 Support => Topic started by: Tama on January 12, 2015, 08:17:15 AM

Title: uilabel won't update
Post by: Tama on January 12, 2015, 08:17:15 AM
I've added a sprite, added a label with resizeHeight as overflow option, anchored to the sprite on all sides except the bottom.

One would think that the vertical position would then be fixed to however I set it. However, if I add text to it in Start() of an attached script, the vertical position is all wrong. If I then select it in the editor and add/remove text, the position moves towards the position I set the top to in the editor.

The hackaround is to add a for loop that adds and removes a space at the end of the text 10 times, and then enables the gameobject.
Title: Re: uilabel won't update
Post by: ArenMook on January 13, 2015, 03:09:03 PM
Just call UpdateAnchors() on it.