- Home /
Is there a simple way to replace a single sprite in a sprite sheet?
Say you have a sprite sheet with say 20 sprites, and you've already incorporated them into your game. And a few months later, all you want to do is upgrade the graphics a little on a single sprite within the sheet.
My concern is that I'd have to delete the entire sprite sheet, import a new updated sheet, and redo everything for every sprite in the sheet.
Is there a simple solution to this problem?
Answer by Loius · Jul 25, 2014 at 05:06 PM
What's preventing you from updating the image? Don't delete the image, just overwrite it.
I think this is pretty much the question I'm asking. I don't know how to simply "update" the image in unity while keeping all the other sprites in the sheet that have been incorporated into the game unaffected.
Oh I see what you mean by just overwriting it. You were assu$$anonymous$$g I was using a texture/sprite packer and importer which handles this for you when you publish and updated sheet. Thanks.
Answer by herman111 · Jul 25, 2014 at 01:43 PM
you just select the sprites you want and add the other to the animation window
What if the sheet isn't used for an animation? For example, what if it's a sprite sheet for the environment and most or all of the sprites in the sheet have been incorporated as some sort of rigidbody ? One example could be like furniture for the inside of a house.
you can select and use any sprite...just replace the one with another one in the sprite renderer
var newSprite : Sprite;
function Start () {
GetComponent(SpriteRenderer).sprite = newSprite;
}
I don't think the sprite renderer allows you to update a sprite sheet, does it?
Your answer
Follow this Question
Related Questions
RigidBody2D rotation on y-axis not z-axis 1 Answer
Using Layer Filter Raycast 0 Answers
Endless 2D background 4 Answers
Texture2D Power of 2 0 Answers
Crushy Bird Game Doubt 1 Answer