Static variables

@:value(new BlobList())staticblobs:BlobList = new BlobList()

@:value(new FontList())staticfonts:FontList = new FontList()

@:value(new ImageList())staticimages:ImageList = new ImageList()

staticprogress:Float

Moves from 0 to 1. Use for loading screens.

@:value(new SoundList())staticsounds:SoundList = new SoundList()

@:value(new VideoList())staticvideos:VideoList = new VideoList()

Static methods

staticloadBlob(name:String, done:Blob ‑> Void, ?failed:AssetError ‑> Void, ?pos:Null<PosInfos>):Void

@:value({ uncompressSoundsFilter : null, filter : null })staticloadEverything(callback:() ‑> Void, ?filter:Dynamic ‑> Bool, ?uncompressSoundsFilter:Dynamic ‑> Bool, ?failed:AssetError ‑> Void):Void

Loads all assets which were detected by khamake. When running khamake (doing so is Kha's standard build behavior) it creates a files.json in the build/{target}-resources directoy which contains information about all assets which were found.

The callback parameter is always called after loading, even when some or all assets had failures.

An optional callback parameter failed is called for each asset that failed to load.

The filter parameter can be used to load assets selectively. The Dynamic parameter describes the asset, it contains the very same objects which are listed in files.json.

Additionally by default all sounds are decompressed. The uncompressSoundsFilter can be used to avoid that. Uncompressed sounds can still be played using Audio.stream which is recommended for music.

staticloadFont(name:String, done:Font ‑> Void, ?failed:AssetError ‑> Void, ?pos:Null<PosInfos>):Void

staticloadImage(name:String, done:Image ‑> Void, ?failed:AssetError ‑> Void, ?pos:Null<PosInfos>):Void

Loads an image by name which was preprocessed by khamake.

Parameters:

name

The name as defined by the khafile.

done

A callback.

staticloadSound(name:String, done:Sound ‑> Void, ?failed:AssetError ‑> Void, ?pos:Null<PosInfos>):Void

staticloadVideo(name:String, done:Video ‑> Void, ?failed:AssetError ‑> Void, ?pos:Null<PosInfos>):Void

staticreporter(custom:AssetError ‑> Void, ?pos:Null<PosInfos>):AssetError ‑> Void