Tasharen Entertainment Forum

Support => NGUI 3 Support => Topic started by: yuewah on March 28, 2014, 05:34:45 AM

Title: Can I specify the UV position of UITexture ?
Post by: yuewah on March 28, 2014, 05:34:45 AM
It would be great to specific portion of UITexture to show. As I don't want to use UIPanel clipping..
Title: Re: Can I specify the UV position of UITexture ?
Post by: UncleAcid on March 28, 2014, 08:33:23 AM
Yes you can.

Quote
You can specify a UV Rectangle that will control which part of the texture will be drawn. X and Y control the UV offset, and W and H control the width and height of the UVs (texture coordinates). Like all texture coordinates, these values are usually 0 to 1 (with 0 meaning one side of the texture and 1 meaning the other). The UVs are bottom-left based, so if you wanted to draw the top 50% of the texture you'd specify UV Rectangle of (0, 0.5, 1, 0.5).

http://www.tasharen.com/forum/index.php?topic=6703.0 (http://www.tasharen.com/forum/index.php?topic=6703.0)