
TexturePacker -sheet "$DIR"/./Resources/layer0.png -data "$DIR"/./Resources/layer0.txt -scale 0.5 -width 1024 -height 1024 -format unity "$DIR"/layer0.tps To fix this issue, I had to modify the script a bit more: Running the script through Finder would simply return an error since the terminal would be in my home directory. TPS file, I would be in Finder, and being able to double-click the script would be nicer than opening a terminal to execute it. I had created a script that I could run through command line, but I wanted the script to be easier to use. The reason is, I had just learned about this option after looking over the command line help! You might ask why I didn’t just set this option in the TexturePacker GUI. One interesting thing to note is the –format option which prevents needing to rename the. The options all correspond with the changes that I mentioned previously. This helps keep the script short and sweet. TPS file such as padding, rotation, algorithm, etc. Note that I can omit changing any of the options that are already set in the. Resources/layer02x.txt -scale 1.0 -width 2048 -height 2048 -format unity layer0.tps Resources/layer0.txt -scale 0.5 -width 1024 -height 1024 -format unity layer0.tps So, this would be a script for one layer for UIToolkit: However, since the output sheets go into a folder that only contain the sheets and data files, so I need to reference these paths relative from where the shell script lives. I placed the script within the directory that contains all our assets. After some tinkering, I came up with a short script that reduces the number of click and edits that I need to make. I began by looking into TexturePacker’s command line options. TPS file, I could simply run a script that would take care of the rest of the work. I wanted a solution such that after editing the. This weekend I had some time to investigate a way to automate this tedious process. This process would be done over and over again, until insanity. Once TexturePacker creates the 4 files (layer0.png, layer0.json, layer02x.png, layer02x.json ), I would rename the. Set the data filename for use with non-retina mobile devices, removing “2X”.UIToolkit will automatically select the appropriate sized sprite sheet to use based on the “2x” extension. I would then need to do the same thing for non-retina devices. Set the sheet filename for use with retina mobile devices, adding “2x”.The sprites get re-arranged then I would perform the following:
#ERROR TEXTUREPACKER SPRITER PNG SERIES#
Once I have received the asset, I must take a series of steps to actually use that asset in Unity. txt files are the metadata files.ĭuring development, I’ll be interrupted every now and then with new and improved assets that need to pushed up into the Unity application. Each sprite sheet ends up corresponding with a layer in UIToolkit, so the sheets we use are typically named “layer0.png”, “layer02x.png”, “layer0.txt”, “layer02x.txt”, where the. At work I use TexturePacker quite a bit to generate sprite sheets for UIToolkit from within Unity.
