Packagestarlingbuilder.engine
Interfacepublic interface IAssetMediator

Interface for getting assets from the project

You should implement your AssetMediator in your project. It can be a simple wrapper of starling.utils.AssetManager.

The following example is a simple implementation of IAssetMediator
          public class AssetMediator
          {
              private var _assetManager:AssetManager;
              
              public function AssetMediator(assetManager:AssetManager)
              {
                  _assetManager = assetManager;
              }
              
              public function getTexture(name:String):Texture
              {
                  return _assetManager.getTexture(name);
              }
              
              public function getTextures(prefix:String="", result:Vector.<Texture>=null):Vector.<Texture>
              {
                  return _assetManager.getTextures(prefix, result);
              }
              
              public function getExternalData(name:String):Object
              {
                  return null;
              }
          }

See also

UIBuilder


Public Methods
 MethodDefined By
  
getExternalData(name:String):Object
Get external data by name.
IAssetMediator
  
getTexture(name:String):Texture
Get texture by name.
IAssetMediator
  
getTextures(prefix:String, result:Vector.<Texture> = null):Vector.<Texture>
Get textures by prefix.
IAssetMediator
Method Detail
getExternalData()method
public function getExternalData(name:String):Object

Get external data by name. Only used by loading external data (a layout referencing other layouts)

Parameters

name:String — of the layout

Returns
Object — external data with matched name
getTexture()method 
public function getTexture(name:String):Texture

Get texture by name. This method has the same signature of starling.utils.AssetManager.getTexture

Parameters

name:String — name of the texture

Returns
Texture — texture with matched name
getTextures()method 
public function getTextures(prefix:String, result:Vector.<Texture> = null):Vector.<Texture>

Get textures by prefix. This method has the same signature of starling.utils.AssetManager.getTextures Only used by MovieClip.

Parameters

prefix:String — prefix of the textures
 
result:Vector.<Texture> (default = null) — vector of the matched textures to return

Returns
Vector.<Texture> — vector of the matched textures