Author Topic: sprite UV  (Read 5566 times)

kicki2k

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 5
    • View Profile
sprite UV
« 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.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: sprite UV
« Reply #1 on: May 18, 2012, 05:05:45 PM »
Select the atlas, choose your sprite, modify its rectangle.

kicki2k

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 5
    • View Profile
Re: sprite UV
« Reply #2 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.
 
« Last Edit: May 19, 2012, 09:35:29 AM by kicki2k »

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: sprite UV
« Reply #3 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.

ryan

  • Jr. Member
  • **
  • Thank You
  • -Given: 0
  • -Receive: 1
  • Posts: 90
    • View Profile
Re: sprite UV
« Reply #4 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.

kicki2k

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 5
    • View Profile
Re: sprite UV
« Reply #5 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.