Tasharen Entertainment Forum

Support => NGUI 3 Support => Topic started by: yantbom on February 24, 2015, 04:43:12 AM

Title: NGUI UISprite problem
Post by: yantbom on February 24, 2015, 04:43:12 AM
Hi, guys !
Here is a problem, need your help. I create UISprite somewhere in UIRoot hierarchy. Then I need to change its sizes at runtime through code (see attached image). For now i look through UISprite documentation and found no possible way to do that, can u plz help me ?
Title: Re: NGUI UISprite problem
Post by: yantbom on February 24, 2015, 09:17:53 AM
Well, apparantly, when dynamically creating sprites u can change its     .width     property only in next frames, not instantly. It solves the problem.
Title: Re: NGUI UISprite problem
Post by: ArenMook on February 24, 2015, 11:44:41 AM
You shouldn't be trying to change the width of something that's anchored on both left and right. Anchor is what sets your width. If you want to adjust the width, anchor on only one side.