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?
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">
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
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.
@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
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.
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!)
@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
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.)
@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.