Sprite packs

How do I create my own sprite pack?

I’ve created a folder MySprites.spritepack in the Codea documents folder, stuck a load of pngs in there, added an Info.plist that I cribbed from https://github.com/TwoLivesLeft/Codea-Runtime/blob/master/CodeaTemplate/SpritePacks/Cargo%20Bot.spritepack/Info.plist, but it doesn’t work.

I get a list of the pngs but no images and all are reported as being 0x0. When I try to use one in my code then Codea crashes. The pngs work fine if they are dumped in the main Codea documents folder but I’d rather segregate them a little otherwise it gets too crowded in there.

What’s the secret?

http://i1251.photobucket.com/albums/hh543/Diablo76600/1fd0d1e0b2b6350d06b2ad73db16a2b7.jpg

Hi, Hard Reset your iPad…

Nope, hard reset didn’t work.

@Simeon are there any instructions on how to create sprite packs so that I can know that I’m doing the right thing?

That’s odd @Andrew_Stacey, I haven’t tried what you’re doing. I’ll have to give it a try and see what the issue is.

@Andrew_Stacey, I just try again and it works, but the file extension must be in lowercase


<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
  <key>Author</key>
  <string>Fiquet Bruno</string>
  <key>Icon</key>
  <string>Snowflakes01</string>
  <key>Link</key>
  <string>Diablo76.com</string>
  <key>Name</key>
  <string>Snowflakes</string>
  <key>Retina</key>
  <true/>
</dict>
</plist>

It would appear to be a problem with the images. The Info.plist is being picked up because the listing in Sprite Packs has the right name and author. But when I go into that folder then although the images are listed, they have no thumbnails and no sizes.

So if you replace them with images from an existing Codea sprite pack, does your custom one display them correctly?

@Simeon No. I just tried downloading a file (Claw Right.png) from https://github.com/TwoLivesLeft/Codea-Runtime/tree/master/CodeaTemplate/SpritePacks/Cargo%20Bot.spritepack and it didn’t work either.

It is clearly reading Info.plist. It is also clearly getting a list of the files in the folder. But it is not able to get any information out of those files. The exact same files work when dumped in the main Documents folder.

I just took the Cargo Bot spritepack from the RunTime and put that there. Again, the Info.plist is being read. Interestingly, this time there was also an Icon in the SpritePack list. But the individual image files still aren’t being read.

I think the directory does not have permission to access
Access Permissions
http://i1251.photobucket.com/albums/hh543/Diablo76600/1a7ebd2e3202f34a7b2dce81ad5824fa.jpg

@Diablo76 Not sure what you mean by that. Codea can access the folder, as witnessed by the fact that it can read Info.plist. So there’s not a permissions/ownsership issue here. Moreover, Codea can read my files when I put them in the main documents folder (so that they appear in the Documents sprite pack).

I just copied the Dropbox.spritepack to DropCopy.spritepack without creating an Info.plist and got exactly the same behaviour: the new sprite pack appears in the list (as null since it has no plist) and the files are listed, but without icons and with image size 0x0.

Copying Claw Right.png to the Documents folder works, to Dropbox.spritepack works, but to MyImages.spritepack does not. Same file, same method of copying in each case.

(Incidentally, @Diablo76, I do appreciate your trying to help me out here!)

like this ??

http://s1251.photobucket.com/albums/hh543/Diablo76600/?action=view&current=2a9f94a2a3e6602ffa805dfe7fd1ab90.jpg

http://s1251.photobucket.com/albums/hh543/Diablo76600/?action=view&current=530f0a463f46f7a6ab85a5ea963b36a7.jpg

@Diablo76 That’s exactly it. I get the first picture. So what did you do to get the second?

My english si very bad and Google translator…c’est l’horreur :frowning:
is MyImages.spritepack folder that is in question and does not allow Codea reading

Edit: your ipad is jailbroken ??

My iPad isn’t jailbroken. I’m using a library called libimobiledevice which gives me access to the Documents directory of apps (i.e. the directory that you can drop things in via iTunes). This access is at the filesystem level so is more flexible than iTunes.

(I could make a stab at reading French if that would be easier.)

Look this video

http://www.youtube.com/watch?v=TMfuqAhhCa4

@Diablo76 Thanks for that. (I guess that the app which allows you to explore the file system is only available for jailbroken iPads, no?)

Looking at that video, then there is a difference between our two circumstances. Codea can definitely read the Info.plist file inside the folder because its contents show up in the sprite list. When you took away the execute permission of the folder then you got Auteur (null) in the list and no pack name, showing that Codea couldn’t even read the Info.plist file. That’s why I don’t think that my issue is due to permissions.

problem of permisson on the images ???

http://s1251.photobucket.com/albums/hh543/Diablo76600/?action=view&current=f0e740bdb0a69f4a758eef36d962af34.jpg
http://s1251.photobucket.com/albums/hh543/Diablo76600/?action=view&current=3c753661190ca7452aea91c568bb996f.jpg