Options
All
  • Public
  • Public/Protected
  • All
Menu

Class AssetFactoryHelper

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

Hierarchy

  • AssetFactoryHelper

Index

Methods

addComplementaryAsset

  • addComplementaryAsset(name: string, asset: any, type?: string): void
  • 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
  • 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
  • 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

getNameFromUrl

  • getNameFromUrl(url: string): string

loadDataFromUrl

  • loadDataFromUrl(url: string, onComplete: function, onError: function): void
  • 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

    Returns void

log

  • log(message: string): void

onBeginRestore

  • onBeginRestore(): void

onEndRestore

  • onEndRestore(): void

Generated using TypeDoc