I need to load a few assets sequentially, and then use them, like this:
myLoadBlob("B1");
myLoadImage("I1");
myLoadImage("I2");
myLoadBlob("B2");
myLoadSound("S1");
myUseAssets();
What is the best way of doing this in Kha?
Help With Asset Loading
I see. I suppose it's great with Assets.loadEverything. One final thing concerning assets. It's a feature request. Could you please implement Image.fromEncodedBytes (PNG and JPG), Sound.fromEncodedBytes (WAV, MP3 and/or OGG), and Font.fromEncodedBytes (TTF (OTF someday would be nice)) in the targets Android, iOS, macOS, and Windows (and others you like)? The reason is very simple: I'd like to package my resources into special files, with each file containing lots of images, or sounds, or whatever. I would then load that special file, isolate a few Bytes, and build the asset from those (encoded) Bytes. It's a sort of atlas thing. I could have all the PNGs for a level in one file, load that file, and build the individual Images with a for loop evoking Image.fromEncodedBytes per iteration. As a bonus, those assets, being parts of larger files, would no longer be available for anyone in Windows, for instance, to rip or modify. What do you think?
Help With Asset Loading
Sound.uncompress works only in native Android, so I had to download cmake. The older version (3.6....) compiles (with lots of warnings), but when trying to install generated apk in device, it says it is corrupt. The newer version (3.10....) doesn't compile. It says
CMake Error: Could not create named generator Android Gradle - Ninja
halfway through.