Sorry about the two long posts back-to-back, I have been furiously editing and refining my thoughts. Here is a proposed solution for sprite pack importing/exporting: Use iTunes file sharing and/or a custom URL scheme to get entire sprite packs into/out of Codea.
Codea would create a subfolder in Documents called SpritePacks, analogous to the SpritePacks folder in the app bundle. Documents/SpritePacks is added to the sprite pack “search path”, and any subfolders in here with the .spritepack extension are treated in code and in the sprite picker as if they were in the app bundle SpritePack folder (i.e. an image file named ace_of_spades.png in “Documents/SpritePacks/Playing Cards.spritepack” would be referenced in code as “Playing Cards:ace_of_spades”).
For explanation purposes, let’s consider a .spz file to be a zipped up folder of sprites (e.g. “Playing Cards.spritepack” would be packaged into Playing Cards.spz).
In the root of the sprite picker UI, there is an “Import” option, that would allow you to select a .spz file in Documents, and would unzip them into a corresponding folder in Documents/Spritepacks. When drilling down into a sprite pack in the sprite picker, an “Export” button would be presented, which would zip up the .spritepack folder to a .spz file and place it in Documents. This seems like a pretty elegant way to package/unpackage sprite packs, and would make them easy to add/extract using iTunes file sharing.
Additionally, we would be able to add images using the sprite picker (or similar UI) from our photo library and dropbox directly into a .spritepack subfolder of Documents/SpritePack, and to delete images from a .spritepack subfolder. So, for example, if in the sprite picker I am currently viewing my “Playing Cards” sprite pack, I would have a button there to add a sprite from my photo library, and a button to add a sprite from my Dropbox.spritepack folder (the Dropbox synching mechanism would stay the way it is now, where all synched dropbox files would live in Dropbox.spritepack). The delete mechanism would work exactly the way it currently does now when I have navigated to the “Documents” folder in the sprite picker, except that it would also be exposed when navigating to the sprite packs that live in the “Documents/SpritePacks” folder. Also, in the root of the sprite picker UI, there would be a button to create a new .spritepack subfolder (so that it would be possible to assemble sprite packs entirely in Codea), and a way to delete a .spritepack subfolder.
Additionally, to facilitate sharing sprite packs with other Codea users, Codea would take any .spz files thrown at it via a custom URL scheme (a la iOS’ app-specific URL capabilities) and automatically unzip them into Documents/SpritePacks. This would actually make it possible to import/export sprite packs without even having to fiddle with iTunes file sharing, since .spz files could be emailed or shared via the web pretty easily. In fact, Codea could allow us to email .spz files to someone as an additional export facility.
I think this is the most elegant solution for hitting all 3 points mentioned in my post above. I’m interested in hearing everyone’s thoughts on this.
Also, fwiw, if we had something like this, there would be no need for project-specific sprite packs. I think having both of these options just adds confusion. For my part, I would definitely prefer this to project-specific sprite packs.