Long time, no blog post, so here’s a quick and easy one to get back into the swing of things. After a season or two away from Corona dev, I’ve recently had reason to return to it to prototype a game. During my time away, Corona’s Sprite API was changed considerably. However, Zwoptex (my sprite sheet generator of choice) has not been updated to output a .lua file that uses the form required by the new API. So here’s the fix for that.
Zwoptex uses template files to generate the actual sprite data files that it outputs for use with Corona, so to get it working with the new API, you need to update that template. The process is pretty straightforward:
- In Finder, head to your ‘Applications’ directory
- Find Zwoptex.app, right-click on it, and select ‘Show Package Contents’.
- In the ‘Contents’ folder, open up ‘Resources’.
- In that folder, you’ll find a file called ‘coronasdk.coordinatesformat.txt’.
- If you want to be super-safe about things, make a backup copy of that file somewhere.
- Open that file in your favourite text editor, and replace it with the following:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
Once that’s done, save it, and the next time you use Zwoptex it will spit out sprite data files compatible with the new API. (If you have Zwoptex open while you do this, you may need to restart it for the changes to take; I honestly can’t remember.)