A small utility library for dealing with assets.
using kex.AssetPackExtension;
final preload = [
ImageAsset('loading', 'preloader/loading-screen.png'),
ImageAsset('progress', 'preloader/progess-bar.png'),
FontAsset('sys', 'inconsolata-bold.ttf'),
];
kha.Assets.loadAssetPack(preload, r -> {
if (r.failures.length > 0) {
trace('failed to preload assets');
return;
}
final bg = r.assets.images.get('loading');
final progress = r.assets.images.get('progress');
final fnt = r.assets.fonts.get('sys');
...
});