Is it possible to hide assets?

Let’s say I have some textures files compressed as .png.

Is it possible to convert that .png into ‘something binary’ that is saved in a .lua file so its getting compiled?

All files in your project folder get compilled when you build app.

Given Corona’s limited capabilities with pixel-graphics, I’m not sure this would work as well as you might think.  I.e. if you somehow converted it to lua code (say a giant array of rgb values), then you’d need some way to spit the pixels back out one at a time … which I don’t think Corona can do.

Is there a particular reason you’d want to do this?

PNG is a binary file format :slight_smile:

If you were to use some other format to store the images, you would probably be looking at significant performance impact because 1) Corona’s image caching wouldn’t work, and 2) there would be overhead for the extra format conversion. And you wouldn’t achieve much. At some point you would be displaying the images anyway, and they could be harvested directly from the screen.

All files in your project folder get compilled when you build app.

Given Corona’s limited capabilities with pixel-graphics, I’m not sure this would work as well as you might think.  I.e. if you somehow converted it to lua code (say a giant array of rgb values), then you’d need some way to spit the pixels back out one at a time … which I don’t think Corona can do.

Is there a particular reason you’d want to do this?

PNG is a binary file format :slight_smile:

If you were to use some other format to store the images, you would probably be looking at significant performance impact because 1) Corona’s image caching wouldn’t work, and 2) there would be overhead for the extra format conversion. And you wouldn’t achieve much. At some point you would be displaying the images anyway, and they could be harvested directly from the screen.