SomaCore plugin to load and manage assets: SomaAssets

| 1 min read

Two new releases today, an asset loader and the SomaCore plugin: SomaAssets.

The AssetLoader library is a port from Matan's AssetLoader library to be event-based, it makes you able to load and manage multiple assets (image, video, xml, sound, etc) in your application.

SomaAssets is a plugin based on the AssetLoader library to easily access to your assets and effectively integrate them in your SomaCore application with paths and automatic mapping name generation for injection.

Special thanks to Matan for his help with the AssetLoader and his joy in general, a pleasure to "meet" him.

You can read the SomaAssets wiki section to get started with it, but I'll post below a few hints of what you can easily do with it within a SomaCore application.

AssetLoader source AssetLoader wiki SomaAssets source SomaAssets wiki

Easily create the plugin and add a XML config file for the assets.

 createPlugin(SomaAssets, new SomaAssetsVO(this, "xml/assets\_config.xml")) 

Easily retrieve the assets with paths through the XML config.

 var image:Bitmap = assets.getAssets("group0/group00/img0"); 

Easily retrieve the plugin, main loader, config and assets with injection in a SomaCore application. The following mapping names have been automatically generated from the XML config.

[Inject(name="assets")]
public var plugin:SomaAssets;

[Inject(name="assets")]
public var loader:IAssetLoader;

[Inject(name="group0/group00/img0")]
public var loaderType1:ImageLoader;

[Inject(name="group0/group00/img0")]
public var assetType1:Bitmap;