Tasharen Entertainment Forum

Support => NGUI 3 Support => Topic started by: kicki2k on May 18, 2012, 03:13:25 PM

Title: sprite UV
Post by: kicki2k on May 18, 2012, 03:13:25 PM
hi,
i have a question.
How do I change the Sprite UV.
Please see the attached file.
Title: Re: sprite UV
Post by: ArenMook on May 18, 2012, 05:05:45 PM
Select the atlas, choose your sprite, modify its rectangle.
Title: Re: sprite UV
Post by: kicki2k on May 19, 2012, 08:52:53 AM
thanks quick reply.
i do not want change sprite's rectangle in atlas.
i want change sprite's  rectangle in UISprite code.
Because it uses the same sprites, UISprite want to apply differently for each rectangle.
 
Title: Re: sprite UV
Post by: ArenMook on May 19, 2012, 11:34:47 AM
Well, that's not how UISprite works. You can't change it on the sprite, only in the atlas.
Title: Re: sprite UV
Post by: ryan on May 19, 2012, 06:38:26 PM
Depending on how flexible you need to be with the UV coordinates, one compromise might be to set up multiple sprites in the atlas that point to overlapping rectangles and cycle through the sprites as needed.  Or if you only have a few instances of UISprite that you need to change, set up a separate entry in the atlas for each one so you can change the rectangle for one without affecting the others.
Title: Re: sprite UV
Post by: kicki2k on May 20, 2012, 11:10:19 AM
ok, i understand.
UISprite class can't change the ractangle.
UISprite class only draw fixed ractangle.
Only in the atlas is to add another name sprite rectangle.

thanks.