Author Topic: Can I specify the UV position of UITexture ?  (Read 1775 times)

yuewah

  • Full Member
  • ***
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 180
    • View Profile
Can I specify the UV position of UITexture ?
« 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..

UncleAcid

  • Jr. Member
  • **
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 51
    • View Profile
Re: Can I specify the UV position of UITexture ?
« Reply #1 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