Tasharen Entertainment Forum

Support => NGUI 3 Support => Topic started by: Pikol on October 22, 2014, 02:44:12 AM

Title: UISprite drawing issue
Post by: Pikol on October 22, 2014, 02:44:12 AM
Hi all.
I've been running into an issue with UISprite.
I have prefab for simple chat message, it have special script - anchor binding that set anchors by some conditions (text size, like phone messages).
Sometimes, when script set anchors, it look like that:
(http://content.screencast.com/users/Pikol/folders/Jing/media/5a973df4-1eba-4e16-827f-092bbefab956/2014-10-22_1037.png)
As you can see - physically sprite placed normally (on right side), but it was drew outside them rect. And what the worst - i have no idea what is going wrong.
Title: Re: UISprite drawing issue
Post by: ArenMook on October 22, 2014, 05:44:49 AM
Do you call UpdateAndResetAnchors after changing them?

Also have a look at EnvelopContent script. It does what its name suggests.
Title: Re: UISprite drawing issue
Post by: Pikol on October 22, 2014, 06:24:36 AM
Thanks for answer, but i use script almost same with EnvelopContent - this script repositions his children inside relative to pivot and fits to total size of all childs.