2D Toolkit Forum

2D Toolkit => Support => Topic started by: negative_zero on September 26, 2016, 12:20:44 am

Title: Replace individual sprites in a SpriteCollection with a sprite sheet?
Post by: negative_zero on September 26, 2016, 12:20:44 am
Hi!

I have a SpriteCollection with 26 individual sprites that I am currently using in a TileMap.  I would like to replace those sprites with a single sprite sheet containing all 26 sprites, without having to go back and place everything again on the TileMap.  However, I can't figure out if this is possible.  If I go into my SpriteCollection and delete the old sprites and add the sprite sheet, the elements in the sprite sheet all have new Sprite IDs (which do not seem to be able to be edited), and I'm not sure how, if even possible, to get them to replace the old sprites instead of having new IDs and acting as totally separate sprites in the TileMap.

Is this possible?  If so, how?!

Thank You.

Title: Re: Replace individual sprites in a SpriteCollection with a sprite sheet?
Post by: ComputerNerd on October 01, 2016, 01:14:18 am
You'll likely be fudging with the internal data, but I don't know the exact process.

What I learned the hard way myself is to store the tile maps separately from Unity through an external 3rd party package.  Tiled, for example, can be easily imported into the 2D Toolkit's Tile Map.  This way in the future if the sprite collection ever becomes corrupted or changes in an unforseen way your tile map won't be lost.  The resulting build files will also be smaller if you load these tmx files at runtime since the data won't be stored in the scene.