- Home /
How to get textures/sprites from Atlas and use it ?
HI,
I would like to use atlas in a mobile game, but i don't really understand how to use it.
I've tried to use Resources.Load but didn't manage to get the sprite needed.
If someone can help me, maybe i'm not using the good method, doc isn't really clear about 2D Atlas
Comment
Answer by Tepei · Oct 02, 2014 at 09:08 AM
This one could help you : http://unity3d.com/learn/tutorials/modules/beginner/2d/sprite-editor
I've tried Sprite Editor, but i want to allow sprites from my atlas dynamically. It's a card game, i create my cards giving them value and texture.
The thing is i found this :
UIAtlas at;
UISpriteData uiSpritedata;
at = Resources.Load<UIAtlas> (path);
uiSpritedata = at.GetSprite ("01");
So i get my SpriteData, where i get the rect. Now, from this, how can i set the texture to my card ?