Options
Menu

Class AssetLibrary

AssetLibrary enforces a singleton pattern and is not intended to be instanced. It's purpose is to allow access to the default library bundle through a set of static shortcut methods. If you are interested in creating multiple library bundles, please use the getBundle() method.

Hierarchy

  • AssetLibrary

Index

Constructors

constructor

  • Creates a new AssetLibrary object.

    Returns AssetLibrary

Accessors

Static conflictPrecedence

  • get (): string
  • set (val: string): void
  • Short-hand for conflictPrecedence property on default asset library bundle.

    see

    AssetLibraryBundle.conflictPrecedence

    Returns string

  • Short-hand for conflictPrecedence property on default asset library bundle.

    Parameters

    • val: string

    Returns void

Static conflictStrategy

  • Short-hand for conflictStrategy property on default asset library bundle.

    see

    AssetLibraryBundle.conflictStrategy

    Returns ConflictStrategyBase

  • Short-hand for conflictStrategy property on default asset library bundle.

    Parameters

    Returns void

Methods

Static addAsset

  • Short-hand for addAsset() method on default asset library bundle.

    see

    AssetLibraryBundle.addAsset()

    Parameters

    Returns void

Static addEventListener

  • addEventListener(type: string, listener: function): void
  • Short-hand for addEventListener() method on default asset library bundle.

    Parameters

    • type: string
    • listener: function

    Returns void

Static createIterator

  • createIterator(assetTypeFilter?: string, namespaceFilter?: string, filterFunc?: any): AssetLibraryIterator
  • Short-hand for createIterator() method on default asset library bundle.

    see

    AssetLibraryBundle.createIterator()

    Parameters

    • Default value assetTypeFilter: string = null
    • Default value namespaceFilter: string = null
    • Default value filterFunc: any = null

    Returns AssetLibraryIterator

Static enableParser

  • enableParser(parserClass: any): void
  • Parameters

    • parserClass: any

    Returns void

Static enableParsers

  • enableParsers(parserClasses: Array<Object>): void
  • Parameters

    • parserClasses: Array<Object>

    Returns void

Static getAllAssets

  • Short-hand for getAsset() method on default asset library bundle.

    see

    AssetLibraryBundle.getAsset()

    Returns Array<IAssetAdapter>

Static getAsset

  • Short-hand for getAsset() method on default asset library bundle.

    see

    AssetLibraryBundle.getAsset()

    Parameters

    • name: string
    • Default value ns: string = null

    Returns IAssetAdapter

Static getBundle

  • Returns an AssetLibrary bundle instance. If no key is given, returns the default bundle (which is similar to using the AssetLibraryBundle as a singleton). To keep several separated library bundles, pass a string key to this method to define which bundle should be returned. This is referred to as using the AssetLibraryBundle as a multiton.

    Parameters

    • Default value key: string = "default"

      Defines which multiton instance should be returned.

    Returns AssetLibraryBundle

    An instance of the asset library

Static getLoader

  • Returns Loader

Static load

  • Short-hand for load() method on default asset library bundle.

    see

    AssetLibraryBundle.load()

    Parameters

    Returns void

Static loadData

  • Short-hand for loadData() method on default asset library bundle.

    see

    AssetLibraryBundle.loadData()

    Parameters

    • data: any
    • Default value context: LoaderContext = null
    • Default value ns: string = null
    • Default value parser: ParserBase = null

    Returns void

Static removeAllAssets

  • removeAllAssets(dispose?: boolean): void
  • Short-hand for removeAllAssets() method on default asset library bundle.

    see

    AssetLibraryBundle.removeAllAssets()

    Parameters

    • Default value dispose: boolean = true

      Defines whether the assets should also be disposed.

    Returns void

Static removeAsset

  • Short-hand for removeAsset() method on default asset library bundle.

    see

    AssetLibraryBundle.removeAsset()

    Parameters

    • asset: IAssetAdapter

      The asset which should be removed from the library.

    • Default value dispose: boolean = true

      Defines whether the assets should also be disposed.

    Returns void

Static removeAssetByName

  • removeAssetByName(name: string, ns?: string, dispose?: boolean): IAssetAdapter
  • Short-hand for removeAssetByName() method on default asset library bundle.

    see

    AssetLibraryBundle.removeAssetByName()

    Parameters

    • name: string

      The name of the asset to be removed.

    • Default value ns: string = null

      The namespace to which the desired asset belongs.

    • Default value dispose: boolean = true

      Defines whether the assets should also be disposed.

    Returns IAssetAdapter

Static removeEventListener

  • removeEventListener(type: string, listener: function): void
  • Short-hand for removeEventListener() method on default asset library bundle.

    Parameters

    • type: string
    • listener: function

    Returns void

Static removeNamespaceAssets

  • removeNamespaceAssets(ns?: string, dispose?: boolean): void
  • Short-hand for removeNamespaceAssets() method on default asset library bundle.

    see

    AssetLibraryBundle.removeNamespaceAssets()

    Parameters

    • Default value ns: string = null
    • Default value dispose: boolean = true

    Returns void

Static stopLoad

  • stopLoad(): void
  • Returns void

Generated using TypeDoc