Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Spritepack fun

BortelsBortels Mod
edited October 2011 in Examples Posts: 1,557

So - I couldn't wait for real sprite pack support; you can hack your way into it while we wait for the real thing. I thought it might be nice to share my notes...

In a nutshell, if you use iExplorer, the sprite packs are stored in Apps/Codify/Codify.app/SpritePacks, in directories like "Planet Cute.spritepack". If you make your own directory there (I used "Test.spritepack"), and upload PNG files (with a lowercase ".png" extension), they'll show up in codify - it's that simple. I tried messing with the info.plist file (copied from one of the stock spritepacks) by editing it with the XCode plist editor, but the changes don't seem to be accepted, so your pack will show as "Art by (null)" and no icon - if anyone can figure out what to do to get Codify to load a nice icon, please post.

I'm hoping that when real spritepack adding comes in, they're tied to the document, not hacked into the app like I'm doing. :-)

Some Links:

iExplorer: http://www.macroplant.com/iexplorer/

My demo code (beginning of a game I'm contemplating): https://gist.github.com/1325166

Screenshots:


The Su-37K sprite I'm testing with is from some awesome pixel art at http://prinzeugn.deviantart.com - I modified the background to transparent alpha with ImageMagick and this little perl script I whipped up: https://gist.github.com/1325189 (takes upper left corner pixel color, floodfills transparent alpha over that color from upper left.)

The other art in the screenshots are mostly from OS X Icon packs I've grabbed over the years, which tend to be perfect for Codify sprites - PNGs with nice alpha channels. I have no idea what the original source was - if someone knows, happy to credit them.

Comments

  • SimeonSimeon Admin Mod
    Posts: 5,412

    Haha excellent work. I had no idea such a thing was possible. Glad you managed to do it. I will have to share this post to show others how to do it.

    Please be careful to backup your spritepacks in case future versions of Codfy do anything stupid. Though I will try to keep this in mind when we introduce official support for custom sprites.

  • BortelsBortels Mod
    Posts: 1,557

    Heh - I fully expect an upgrade to clobber these hacked-in sprite packs; I wouldn't worry about it, and I don't suggest you spend time on it - figure out the right way for us to do this properly instead. As a suggestion, if apple doesn't like doing it via iTunes (I don't either!), an "importSpritepackFromURL("http://whatever")" command would be easy to use and shouldn't tweak apple much, it not being code. (this would check if the sprite pack was already downloaded, and if not fetch and install it)

  • would be lovely. or just gasping a .json covering assets from an URL.

  • Even importing a whole project from a URL would be nice (code/graphics/sounds/data externally created), with some way of telling Codea to overwrite a project it has already with the same name/id ?

  • Posts: 1

    I'd like to see support for camera roll import so i can bring gfx from sketchbook pro or similar software. Importing music/sounds from other ipad apps (garageband?) would rock too, but dunno how that could be made unless he sounds can be saved in itunes library

  • edited November 2011 Posts: 8

    Excellent! Great job!
    I've made some trial&error test to workaround the Art by (null) message in the packs list and I did it!
    Here's the steps I've done, hope someone will find them useful!

    -First copy from one of the sprite pack folder the info.plist file on your Desktop.

    -Edit the file fields with whatever you want (every text editor should do the task, even notepad: the file is just an XML file), they're pretty self explicatives. The most important is the last field (the Icon field), I've left it untouched.

    -Save the file and copy into your own sprite pack folder with iExplore.

    -Edit a png file with 110x110 pixel and a resolution of 72 dpi with the desired icon, and save it with the name Icon.png. Pay attention to the capital I in the name. The app seems to be case sensitive. I've used Gimp to edit my icon, it's a very powerful tool and it will let you do the job in one minute using the 'scale' command.

    -Copy the Icon.png file into your folder with iExplore.

    That's done!

    While waiting for the next codify update with the new upload feature, you'll have the satisfaction to see your own spritepacks with an outstanding self made icon!

  • BortelsBortels Mod
    Posts: 1,557

    Hmm - there's got to be something more; I had done all of that, but my Icon.png wasn't 110x110. I resized it, re-uploaded - and same behavior. It's almost like it's not seeing the new plist at all (given the "Art by (null)" showing up).

    When it's working for you, does it show "Art by [whatever it was in your plist]"?

  • Mmm...
    There's just one more thing I've done that I didn't mention, I though it was not so important... :-S

    After uploading the two files I've shutdown completely cod(ea | fy) by double clicking the iPad button and shutting down the app in the quick-app bar.

    In the first tries I didn't manage to see the icon (I forgot the starting capital I) but at least I was able to see the sprtepack name and the author I modified.

    Let me know if that helps.

  • BortelsBortels Mod
    Posts: 1,557

    Alas, no - I had tried that when iExporer had issues updating files that Codify was holding open.

    (side note - I am unable to delete directories with iExplorer. No idea how to work around, so I have copies of "Test.spritepack" all over the Codify.app. It's grim.)

  • I had some problems too with iExplore. Did not try to delete any folder, but with file it works.

    Things appear to go smoother if I uncheck the flag in the preferences concerning the 'real root' (it auto enables itself randomly while using the prog, don't know why.)

    However, I did not done anything else (at least as I remember).

  • Here's an image of the results. I've used the same sprite you mentioned in your first post.

    The second pack list is deleted cause the images I've used are copyrighted and I haven't the permission to publish them.

  • Posts: 40

    Has anyone devised a method for downloading and or creating sprites like the ones you have displayed here Bortels without having to use a computer

  • BortelsBortels Mod
    Posts: 1,557

    Nope. Closest thing to do is use Spritely and make your own. TLL knows we want it. :-)

  • Posts: 2,820

    I'm getting impatient. I also want a Mac app that converts the images to code.

  • Posts: 2,820

    Would people actually use an app I would make (in Apple Script, or Automator, or whatever) that does this? Just wondering cuz I might.

  • Posts: 40

    Yes I totally would @ Zoyt

  • edited January 2012 Posts: 2,820

    Hmm. Alright @MICHAEL. Your the only one to respond, but I'm sure many would use it. I'll see if there is any way to access iOS devices thru terminal. If you can help, LMK. If everybody had Phone Disk, that would be nice, but it's $20. I'll play with libmobiledevice and see what I can do. I'm always open for help.
    P.S. @MICHEAL - Don't put a space between the @ and the user name. I didn't get your callout.

  • Posts: 40

    @Zoyt if there is anything I can do to help let me know I'm always available.

  • Posts: 2,820

    @MICHAEL - Alright. Thanks. 2 things. Are you on a Mac or PC. Also, are you good with Unix or terminal or AppleScript? Thanks for offering.

  • Posts: 40

    @Zoyt i have a pc it's running xp and I have never used Unix Terminal or Apple script sorry I'm a pretty fast learner tho.

  • Posts: 2,820

    Alright. Side note: You might play with installing an old version of Mac OS on VirtualBox. I'll let you know if you can help. But I'm assuming you won't be able to run it. Sorry about that. I do highly suggest getting a Mac eventually. I'll see if there is any way at all I can code this for both Mac and PC.

  • Posts: 40

    Ok I found an old I Mac for sale for $200 is that a good deal it's running sox tiger or something like that

  • Posts: 2,820

    I think it will work. Unix and AppleScript hasn't changed that much. If your going to do it for this project, let me make sure it's worth it and let's change this to a private conversation. I'm probably going to do something with libmobiledevice so feel free to do some research. I'm looking onto it also.

  • Posts: 2,820
  • Posts: 40

    Ok @zoyt

Sign In or Register to comment.