Author Topic: get a small part from atlas texture  (Read 1394 times)

compass

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 2
    • View Profile
get a small part from atlas texture
« on: May 05, 2015, 03:05:50 AM »
Hi guys!
Our team want to reuse a packed texture.
The texture is used to be an atlas, which many card pictures are packed into it.
Yet my boss want to get the character's head icon from each cards in that atlas.
He told me that there must be some way to use coordinates to just get the character's face from the whole texture.
Is there any solution to this problem?

It seems my boss need 2 atlas yet he only want to keep all these pictures on 1 texture.

thanks very much!

compass

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 2
    • View Profile
Re: get a small part from atlas texture
« Reply #1 on: May 05, 2015, 04:51:58 AM »
OK. I think I get the solution.

Each UIAtlas has a list of UISpriteData, and each UISpriteData has its own coordinates and size. So I just need to set the coordinates and size for the new sprites. ;)