- Home /
Get a sprite from a Sprite Packer atlas?
Hello, how can I get a sprite from an atlas created using Unity's built-in Sprite Packer? I need the info in order to assign it to an Image component at runtime. Thanks!
I would also love to hear how to achieve this. Did you find a solution yet?
Nope, I haven't found a way to do this. So for now I just put my pictures in a Resources folder and access them from Resources.Load...
It seem that for now the only way to do this, is having an object in your scene with the references to the single sprites and get them from there. apparently unity hasn't a way to get a single sprite from the sprite packed atlas. at least for now :( (I'm having the same trouble as you)
Answer by unimechanic · Dec 09, 2014 at 08:05 PM
The Sprite reference has all the information that you need:
No. To create a Sprite you need to know the rect on the (atlas)texture. But that is the information that is missing in this case.
Or did i miss something?
In fact, no, if you take a single second to read what this person is asking about, you will find out that your answer is the most useless thing on the world.