A helper class that's passed to an AssetFactory's "create" method.

### Hierarchy

- AssetFactoryHelper

## Index

### Methods

- addComplementaryAsset
- addPostProcessor
- executeWhenContextReady
- getExtensionFromUrl
- getNameFromUrl
- loadDataFromUrl
- log
- onBeginRestore
- onEndRestore

## Methods

### addComplementaryAsset

- addComplementaryAsset(name: string, asset: any, type?: string): void

- - Defined in lib/starling/assets/AssetFactoryHelper.d.ts:60

  Adds additional assets to the AssetManager. To be called when the factory creates more than one asset.

  #### Parameters

  - ##### name: string

  - ##### asset: any

  - ##### Optional type: string

  #### Returns void

### addPostProcessor

- addPostProcessor(processor: function, priority?: number): void

- - Defined in lib/starling/assets/AssetFactoryHelper.d.ts:45

  Adds a method to be called by the AssetManager when the queue has finished processing. Useful e.g. if assets depend on other assets (like an atlas XML depending on the atlas texture).

  @param processor function(manager:AssetManager):void; @param priority Processors with a higher priority will be called first. The default processor for texture atlases is called with a priority of '100', others with '0'.

  #### Parameters

  - ##### processor: function

    - - (AssetManager: any): void

      - #### Parameters

        - ##### AssetManager: any

        #### Returns void

  - ##### Optional priority: number

  #### Returns void

### executeWhenContextReady

- executeWhenContextReady(call: Function, args?: Array<any>): void

- - Defined in lib/starling/assets/AssetFactoryHelper.d.ts:65

  Delay the execution of 'call' until it's allowed. (On mobile, the context may not be accessed while the application is in the background.)

  #### Parameters

  - ##### call: Function

  - ##### Optional args: Array<any>

  #### Returns void

### getExtensionFromUrl

- getExtensionFromUrl(url: string): string

- - Defined in lib/starling/assets/AssetFactoryHelper.d.ts:25

  Forwarded to the AssetManager's method with the same name.

  #### Parameters

  - ##### url: string

  #### Returns string

### getNameFromUrl

- getNameFromUrl(url: string): string

- - Defined in lib/starling/assets/AssetFactoryHelper.d.ts:22

  Forwarded to the AssetManager's method with the same name.

  #### Parameters

  - ##### url: string

  #### Returns string

### loadDataFromUrl

- loadDataFromUrl(url: string, onComplete: function, onError: function): void

- - Defined in lib/starling/assets/AssetFactoryHelper.d.ts:34

  Accesses a URL (local or remote) and passes the loaded ByteArray to the 'onComplete' callback - or executes 'onError' when the data can't be loaded.

  @param url a string containing an URL. @param onComplete function(data:ByteArray, mimeType:string):void; @param onError function(error:string):void;

  #### Parameters

  - ##### url: string

  - ##### onComplete: function

    - - (data?: ByteArray, mimeType?: string, name?: string, extension?: string): void

      - #### Parameters

        - ##### Optional data: ByteArray

        - ##### Optional mimeType: string

        - ##### Optional name: string

        - ##### Optional extension: string

        #### Returns void

  - ##### onError: function

    - - (string: any): void

      - #### Parameters

        - ##### string: any

        #### Returns void

### log

- log(message: string): void

- - Defined in lib/starling/assets/AssetFactoryHelper.d.ts:56

  Forwarded to the AssetManager's method with the same name.

  #### Parameters

  - ##### message: string

  #### Returns void

### onBeginRestore

- onBeginRestore(): void

- - Defined in lib/starling/assets/AssetFactoryHelper.d.ts:49

  Textures are required to call this method when they begin their restoration process after a context loss.

  #### Returns void

### onEndRestore

- onEndRestore(): void

- - Defined in lib/starling/assets/AssetFactoryHelper.d.ts:53

  Textures are required to call this method when they have finished their restoration process after a context loss.

  #### Returns void

Generated using TypeDoc