Is it possible (and then how) to load and play a APNG file as an animation sequence in a TCastleScene?
Up until now I use single png files with multiple images in a TCastleScene but it would be awesome if I can just load an APNG animation file and put it in the TCastleScene.
We don’t support APNG files now. It would be cool (we would internally convert them to sprite sheets to play efficiently) but it’s not implemented at this point.
The best recommendation for now is to split them into multiple images (e.g. ffmpeg on the command-line should be able to output a series of static images from APNG) and then use our sprite sheet editor (“Data → New Sprite Sheet” in CGE editor) to compose them into a sprite sheet. Then you can load such sprite sheet into a TCastleScene and play animations from it.
It would be great if this was possible.
Meanwhile I found some online service for instantly making one sprite image out of an uploaded APNG.
Now I would like that sprite images cannot be viewed on disk (saved in the map “data” in CGE project by the user), but in a different format so that only the CGE project can open or decompress it and load in the TCasteScene the moment it is needed while playing the game. Is this possible?
I’m not certain do I understand this question, sorry, I need more information
Do you mean you want to protect the generated sprite sheet from opening by the user, in order to avoid user’s stealing your graphics (reusing it in their own projects without your permissions)? If that is the case, you could encrypt the data. Demo how to do this for web applications is on
You can apply a similar technique to non-web games, with a little bit of extra coding – hopefully the above example will be helpful. The idea is that you encrypt the data before packaging it, and then your Pascal code registers special URL scheme, that opens the data and decrypts it, using a key embedded in exe. It’s not a “magic” technique, it will not protect your data from all abuse (see above links for more explanation why it’s not really possible), but it avoids your data files being trivially accessible.