It snowed here in Boston on Wednesday. Enough that I didn’t make it out of the house. Or at least not out of the driveway with shovel in hand. So, with a day off, I worked on adding features to SWFSheet. From yesterday’s post, I successfully implemented features 1-3. To recap and expand:
1. PNG Sequence Export. Click on the new button “Export PNG Sequence” and a small window will pop up. Here you can enter the prefix to save the files with (“frame_” by default), and browse to a directory to store them.
2. Custom Sprite Sheet Sizes. There’s a new radio button in the size section, called “Custom”. There’s also a button there that will pop up another small window allowing you to set the size of the custom sprite sheet size, up to 4096×4096. Nuff said.
3. MetaData Saving. Click the Save MetaData button and yet another small window will open. This has a group of radio buttons allowing you to choose an export format. The first is the Zwoptex xml/plist format used by cocos2d. Then the Corona format, which should save in a format defined here. There’s a generic XML format I created, and the Sparrow format, which is essentially the same with slightly different names, and a raw text format that is just a comma-delimited, one-frame-per-line text dump of x,y,w,h.
As I write this, a few people are testing the new build, and so far so good. But I’m releasing this as a beta, just as a warning that the new stuff may not be thoroughly tested – particularly the export formats. In fact, they might not be tested at all. So try them out and let me know if you run into any issues and I’ll correct them ASAP.
As for more advanced texture packing, I’ve pretty much decided against doing anything on this. I’ve had a couple of offers to share code or collaborate on packing algorithms, but I think I’m going to decline. For one, there are already some great tools out there that do a good job of this. Zwoptex as I’ve mentioned, and also TexturePacker. It would take a LOT of work on my part to come close to what they do in that regard. They also do stuff like PVR generation, and multiple bitmap formats, dithering, transparency masking, etc. So I’m not going to bother trying to compete with these products, but do something that works well with them.
The other point is that with the new PNG Sequence Export feature, SWFSheet will work in conjunction with these or any other tools wonderfully. Load your sprite, set the frame, number of frames, etc. and export a PNG sequence. Load that into one of these other tools and pack away. This doesn’t belittle the value of SWFSheet at all. Those other tools cannot make sprite sheets from SWFs. And there’s no good way to get image sequences out of Flash, so they complement each other perfectly.
You might be saying to yourself, “but Flash already has an image sequence exporter.” But if you’re saying that, you’ve never actually tried to use it. It’s virtually useless. Yes, it will export a sequence of the frames on the main timeline. But what if you have animations in nested clips? Nope. Animations set up with code on enterFrame events? Nah. Timer-based animation? Tween libraries? Forget about it! SWFSheet will export PNG sequences from all those without a problem. In fact, the more I thought about it, the more I realized that the PNG Sequence Export is really a pretty awesome feature all by itself.
So here for your pleasure, is SWFSheet 1.1 beta. Use it, abuse it, give me feedback.