Auto Extrude Tilesheet or Spritesheet in Unity for Free
Long time no post, recently I have been working on some other projects or nothing at all but came by this fix online and thought I should share it.
If you work with Unity at all (and I am guessing you do or you would not have found yourself at this page) you know how frustrating it is dealing with the way Unity handles 2D sprites and tiles. The only way to get rid of the little lines that sometimes show on the top or bottom of a given sprite is to extrude the tiles but keep the settings in Unity the same.
The only solutions I found when trying to solve this cost money like TexturePacker by Code+Web. I am guessing that is a really nice tool but I decided the problem wasnt worth money and worst case I could manually do it (too much time) or make a little program to do it for me (also a lot of time).
I stumbled on this post from 2011 and it had the perfect solution.
If you follow the link above there is a nice little editor package, if you use it, it will auto extrude a tileset or spritesheet within unity for you.
- Download the package from the link
- Add the package to your project
- Select your tilesheet/spritesheet within Unity
- On the Menu select Mudloop (if you dont see this between Tools and Window, click around the menus a bit)
- Select Texture Padder
- Change or Accept the default options
- Select a spot to save the new tilesheet/spritesheet
Here is an example, on the left you have the original 32 by 32 pixel tile. Note the borders on the top, right, and bottom. (it was on the edge of the sheet so it has no tile to the left of it) On the right is after using the script, it is now a 34 by 34 pixel tile and has added a 1 pixel border that extrudes the original tiles borders.
I have been considering posting more Unity tutorials and logging some sort of Journal on the game I am working on…so maybe soon the site will see some more activity.
Here is a small clip to show where I am at with that.
1756 Views // February 18, 2018