- Home /
Question by
drodrii · Sep 13, 2014 at 03:07 PM ·
guitexturespritespriterendererspritesheet
Gui Box - Texture - Spritesheet
So, I have a box which i want to add a sprite(image) to it instead of text. But it needs a texture.
I've done this: (model is a gameObject)
spriteRenderer = model.GetComponent<SpriteRenderer>();
iconTexture = spriteRenderer.sprite.texture;
My only problem here is that the model is using a spritesheet and when i call iconTexture I get the whole spritesheet and not just the first frame of the sSheet. Is there any way to access just one frame of the spriteSheet?
Thanks for your time and help! have a good one.
Comment
Your answer
Follow this Question
Related Questions
Gui.Box - Sprite 0 Answers
How to create a GUI like Zombieville? 1 Answer
Override sprite geometry of sprite generated at runtime 1 Answer
Sprite editor and texture 1 Answer
How to truncate sprite without changing the scale of the sprite? 1 Answer