Author Topic: Possible to get sprite UV coords from inside an atlas?  (Read 3740 times)

Shifty Geezer

  • Full Member
  • ***
  • Thank You
  • -Given: 7
  • -Receive: 9
  • Posts: 226
    • View Profile
Possible to get sprite UV coords from inside an atlas?
« on: January 31, 2014, 06:32:27 AM »
As an optimisation I'd like to use the NGUI sprite atlas as the source of my in-game sprites. Is there a way to get sprite UVs so I can create a quad textured with the atlas texture and set the UVs to a specific image?

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Possible to get sprite UV coords from inside an atlas?
« Reply #1 on: January 31, 2014, 11:25:47 AM »
atlas.GetSprite("sprite name") gives you all you need (combined with texture's width and height)

Shifty Geezer

  • Full Member
  • ***
  • Thank You
  • -Given: 7
  • -Receive: 9
  • Posts: 226
    • View Profile
Re: Possible to get sprite UV coords from inside an atlas?
« Reply #2 on: February 01, 2014, 12:24:22 PM »
Thanks